Skip to content

Commit

Permalink
free memory before exiting
Browse files Browse the repository at this point in the history
fixes #23
  • Loading branch information
miniupnp committed Aug 25, 2022
1 parent 5d928cb commit 3a44ac7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions gif2tga.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,11 @@ int main(int argc, char * * argv) {
ftga = fopen(tganame, "wb");
if(ftga == NULL) {
fprintf(stderr, "cannot open file %s for writing.\n", tganame);
fclose(fgif);
#ifdef NGIFLIB_NO_FILE
free(buffer);
#endif
GifDestroy(gif); /* libere la ram */
return 5;
}
putc(0, ftga); /* 0 */
Expand Down

0 comments on commit 3a44ac7

Please # to comment.