+ goto out_close_image_fp;
+ }
+
+ ret = fread(image, size, 1, image_fp);
+ if (ret != 1) {
+ if (feof(image_fp))
+ fprintf(stderr, "Unexpected end of file.\n");
+ else if (ferror(image_fp))
+ perror("fread");
+ else
+ fprintf(stderr, "Unexpected error condition.\n");
+
+ goto out_free_image;