summaryrefslogtreecommitdiffstats
path: root/tools/h4toh5main.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/h4toh5main.c')
-rw-r--r--tools/h4toh5main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/h4toh5main.c b/tools/h4toh5main.c
index c936b1b..9881ce0 100644
--- a/tools/h4toh5main.c
+++ b/tools/h4toh5main.c
@@ -560,7 +560,7 @@ int get_numof_hdf4obj(char*filename,int32 file_id) {
int set_helpgroups(hid_t h5root,hid_t* h5dimgptr,hid_t* h5palgptr){
- hid_t h5_dimg;/* hdf5 dimensional scale group identifier. */
+ hid_t h5_dimg=(-1);/* hdf5 dimensional scale group identifier. */
hid_t h5_palg;/* hdf5 palette group identifier. */
/*1. dimensional scale group.*/
@@ -581,7 +581,7 @@ int set_helpgroups(hid_t h5root,hid_t* h5dimgptr,hid_t* h5palgptr){
h5_palg = H5Gcreate(h5root,HDF4_PALG,0);
if(h5_palg <0) {
printf("error in creating hdf5 palette group. \n");
- H5Gclose(h5_dimg);
+ if(h5_dimg>0) H5Gclose(h5_dimg);
return FAIL;
}