Fix a resource leak: close fp before return (found by cppcheck)

This commit is contained in:
Kathryn Davies 2018-03-30 15:42:56 -07:00
parent 9386a414fc
commit 147f835146

View File

@ -71,6 +71,7 @@ ImagingSavePPM(Imaging im, const char* outfile)
fprintf(fp, "P6\n%d %d\n255\n", im->xsize, im->ysize);
} else {
(void) ImagingError_ModeError();
fclose(fp);
return 0;
}