Fix bad call to fclose with NULL pointer

This commit is contained in:
mayeut 2016-04-30 01:50:33 +02:00
parent be42e72d22
commit f40a2ff2ad
1 changed files with 38 additions and 39 deletions

View File

@ -1913,7 +1913,6 @@ if(v > 65535) v = 65535; else if(v < 0) v = 0;
destname = (char*)malloc(strlen(outfile) + 8); destname = (char*)malloc(strlen(outfile) + 8);
if(destname == NULL){ if(destname == NULL){
fprintf(stderr, "imagetopnm: memory out\n"); fprintf(stderr, "imagetopnm: memory out\n");
fclose(fdest);
return 1; return 1;
} }
for (compno = 0; compno < ncomp; compno++) for (compno = 0; compno < ncomp; compno++)