summaryrefslogtreecommitdiffstats
path: root/src/H5Tenum.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5Tenum.c')
-rw-r--r--src/H5Tenum.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/H5Tenum.c b/src/H5Tenum.c
index f955a7e..6da6931 100644
--- a/src/H5Tenum.c
+++ b/src/H5Tenum.c
@@ -466,10 +466,11 @@ H5T_enum_nameof(const H5T_t *dt, const void *value, char *name/*out*/, size_t si
/* Set return value */
ret_value=name;
- if (H5T_close(copied_dt)<0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCLOSEOBJ, NULL, "unable to close data type");
-
done:
+ if(copied_dt)
+ if(H5T_close(copied_dt) < 0)
+ HDONE_ERROR(H5E_DATATYPE, H5E_CANTCLOSEOBJ, NULL, "unable to close data type");
+
FUNC_LEAVE_NOAPI(ret_value)
}
@@ -591,9 +592,11 @@ H5T_enum_valueof(const H5T_t *dt, const char *name, void *value/*out*/)
HDmemcpy(value, copied_dt->shared->u.enumer.value+md*copied_dt->shared->size, copied_dt->shared->size);
- if (H5T_close(copied_dt)<0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCLOSEOBJ, FAIL, "unable to close data type");
-
done:
+ if(copied_dt)
+ if(H5T_close(copied_dt) < 0)
+ HDONE_ERROR(H5E_DATATYPE, H5E_CANTCLOSEOBJ, FAIL, "unable to close data type")
+
FUNC_LEAVE_NOAPI(ret_value)
}
+