From e60138117caaafc0f9b422e5e3f1654127e4287a Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 1 Aug 2009 06:27:40 +0000 Subject: - Ancient resource leak (rev 2) where checkPackedFile would open a file and never close it. - Running simulations missed freeing some variables. --- source/blender/imbuf/intern/targa.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'source/blender/imbuf') diff --git a/source/blender/imbuf/intern/targa.c b/source/blender/imbuf/intern/targa.c index 303e5685503..6a974464f56 100644 --- a/source/blender/imbuf/intern/targa.c +++ b/source/blender/imbuf/intern/targa.c @@ -289,7 +289,10 @@ short imb_savetarga(struct ImBuf * ibuf, char *name, int flags) fildes = fopen(name,"wb"); if (!fildes) return 0; - if (fwrite(buf, 1, 18,fildes) != 18) return (0); + if (fwrite(buf, 1, 18,fildes) != 18) { + fclose(fildes); + return (0); + } if (ibuf->cmap){ for (i = 0 ; imaxcol ; i++){ -- cgit v1.2.3