From be9382acfb55df4aa407ce0f313ee8c0fbd1ccc1 Mon Sep 17 00:00:00 2001 From: Alex Marshall Date: Tue, 19 May 2009 23:45:40 -0700 Subject: Alright, THIS BETTER WORK >_< --- zetsubou/tpl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'zetsubou') diff --git a/zetsubou/tpl.c b/zetsubou/tpl.c index c6106c7..eb9b12f 100644 --- a/zetsubou/tpl.c +++ b/zetsubou/tpl.c @@ -95,8 +95,6 @@ int TPL_ConvertRGBA8ToBitMap(u8* tplbuf, u32 tplsize, u32 tplpoint, u8** bitmapd u32 goodheight = height; u32 x, y; u32 x1, y1; - if(*bitmapdata != NULL) - free(*bitmapdata); *bitmapdata = (u8*)calloc(width * height, 4); if(*bitmapdata == NULL) return -1; @@ -820,6 +818,7 @@ int TPL_ConvertToGD(u8* tplbuf, u32 tplsize, char basename[], u32 format) fwrite(&h.max_lod, 1, 1, tplmeta); fwrite(&h.unpacked, 1, 1, tplmeta); fclose(tplmeta); + free(bitmapdata); } free(outname); return 0; @@ -1134,6 +1133,7 @@ int TPL_ConvertToBMP(u8* tplbuf, u32 tplsize, char basename[]) fwrite(&h.max_lod, 1, 1, out); fwrite(&h.unpacked, 1, 1, out); fclose(out); + free(subbitmapdata); } free(outname); return 0; -- cgit v1.3.1