summaryrefslogtreecommitdiffstats
path: root/hl/tools
diff options
context:
space:
mode:
Diffstat (limited to 'hl/tools')
-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;
}