From d5592fe254c7061ca8bbcea93b6098dc9bf3d683 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 26 Dec 2009 20:23:13 +0000 Subject: fixes for errors/warnings found with cppcheck --- source/blender/imbuf/intern/targa.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'source/blender/imbuf/intern/targa.c') diff --git a/source/blender/imbuf/intern/targa.c b/source/blender/imbuf/intern/targa.c index c89bc6a632f..acc3e06448f 100644 --- a/source/blender/imbuf/intern/targa.c +++ b/source/blender/imbuf/intern/targa.c @@ -296,7 +296,10 @@ short imb_savetarga(struct ImBuf * ibuf, char *name, int flags) if (ibuf->cmap){ for (i = 0 ; imaxcol ; i++){ - if (fwrite(((uchar *)(ibuf->cmap + i)) + 1,1,3,fildes) != 3) return (0); + if (fwrite(((uchar *)(ibuf->cmap + i)) + 1,1,3,fildes) != 3) { + fclose(fildes); + return (0); + } } } -- cgit v1.2.3