summaryrefslogtreecommitdiffstats
path: root/hl
diff options
context:
space:
mode:
authorPedro Vicente Nunes <pvn@hdfgroup.org>2007-04-10 19:42:42 (GMT)
committerPedro Vicente Nunes <pvn@hdfgroup.org>2007-04-10 19:42:42 (GMT)
commit79a2871982693ad80104424d37458eda656bad4f (patch)
treee00338e6a078bf9d37dfab7c42c458b7e87a223d /hl
parenta97a33b6ff35052010820f87391da6e99cca0a8c (diff)
downloadhdf5-79a2871982693ad80104424d37458eda656bad4f.zip
hdf5-79a2871982693ad80104424d37458eda656bad4f.tar.gz
hdf5-79a2871982693ad80104424d37458eda656bad4f.tar.bz2
[svn-r13628]
test for a NULL pointer in free tested: linux
Diffstat (limited to 'hl')
-rw-r--r--hl/tools/gif2h5/hdf2gif.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/hl/tools/gif2h5/hdf2gif.c b/hl/tools/gif2h5/hdf2gif.c
index 060c7b0..d404322 100644
--- a/hl/tools/gif2h5/hdf2gif.c
+++ b/hl/tools/gif2h5/hdf2gif.c
@@ -65,7 +65,7 @@ int main(int argc , char **argv)
int arg_index = 2;
int bool_is_image = 0; /* 0 = false , 1 = true */
- char *image_name;
+ char *image_name = NULL;
int idx;
if (argc < 4)
@@ -307,9 +307,8 @@ int main(int argc , char **argv)
if (fpGif != NULL)
fclose(fpGif);
-
- free(image_name);
-
+ if (image_name != NULL)
+ free(image_name);
return 0;
@@ -318,9 +317,8 @@ out:
if (fpGif != NULL)
fclose(fpGif);
-
- free(image_name);
-
+ if (image_name != NULL)
+ free(image_name);
return 1;
}