diff options
author | Pedro Vicente Nunes <pvn@hdfgroup.org> | 2007-04-11 16:38:15 (GMT) |
---|---|---|
committer | Pedro Vicente Nunes <pvn@hdfgroup.org> | 2007-04-11 16:38:15 (GMT) |
commit | 5588dbd8d74d0cd0c689312ffa3f6815cc94fee9 (patch) | |
tree | 3047b9526053eb075e6e5f915fb58a1f7dabd6f0 /hl/tools/gif2h5 | |
parent | 9d2070890b0cfb2c8a406906da0470e948141db4 (diff) | |
download | hdf5-5588dbd8d74d0cd0c689312ffa3f6815cc94fee9.zip hdf5-5588dbd8d74d0cd0c689312ffa3f6815cc94fee9.tar.gz hdf5-5588dbd8d74d0cd0c689312ffa3f6815cc94fee9.tar.bz2 |
[svn-r13638]
bug fix
memory leaks
tested: linux
Diffstat (limited to 'hl/tools/gif2h5')
-rw-r--r-- | hl/tools/gif2h5/gif2hdf.c | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/hl/tools/gif2h5/gif2hdf.c b/hl/tools/gif2h5/gif2hdf.c index 99dc3fd..9906a96 100644 --- a/hl/tools/gif2h5/gif2hdf.c +++ b/hl/tools/gif2h5/gif2hdf.c @@ -109,13 +109,42 @@ main(int argv , char *argc[]) if (gifImageDesc.Image != NULL) free(gifImageDesc.Image); + + if (GifMemoryStruct.GifImageDesc[i] != NULL) + { + free(GifMemoryStruct.GifImageDesc[i]); + GifMemoryStruct.GifImageDesc[i] = NULL; + } if (GifMemoryStruct.GifGraphicControlExtension[i] != NULL) + { free(GifMemoryStruct.GifGraphicControlExtension[i]); + GifMemoryStruct.GifGraphicControlExtension[i] = NULL; + } } free(StartPos); - free(GifMemoryStruct.GifHeader); - free(GifMemoryStruct.GifApplicationExtension); + if (GifMemoryStruct.GifHeader != NULL) + { + free(GifMemoryStruct.GifHeader); + GifMemoryStruct.GifHeader = NULL; + } + if (GifMemoryStruct.GifApplicationExtension != NULL) + { + free(GifMemoryStruct.GifApplicationExtension); + GifMemoryStruct.GifApplicationExtension = NULL; + } + if (GifMemoryStruct.GifImageDesc != NULL) + { + free(GifMemoryStruct.GifImageDesc); + GifMemoryStruct.GifImageDesc = NULL; + } + if (GifMemoryStruct.GifGraphicControlExtension != NULL) + { + free(GifMemoryStruct.GifGraphicControlExtension); + GifMemoryStruct.GifGraphicControlExtension = NULL; + } + + return 0; } |