summaryrefslogtreecommitdiffstats
path: root/src/H5.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5.c')
-rw-r--r--src/H5.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/H5.c b/src/H5.c
index 3372250..71defe7 100644
--- a/src/H5.c
+++ b/src/H5.c
@@ -140,20 +140,22 @@ H5_init_library(void)
herr_t
H5_add_exit(void (*func) (void))
{
- herr_t ret_value = SUCCEED;
H5_exit_t *new_exit;
FUNC_ENTER_INIT(H5_add_exit, NULL, FAIL);
assert(func);
- new_exit = H5MM_xcalloc(1, sizeof(H5_exit_t));
+ if (NULL==(new_exit = H5MM_calloc(sizeof(H5_exit_t)))) {
+ HRETURN_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL,
+ "memory allocation failed");
+ }
new_exit->func = func;
new_exit->next = lib_exit_head;
lib_exit_head = new_exit;
- FUNC_LEAVE(ret_value);
+ FUNC_LEAVE(SUCCEED);
} /* end H5_add_exit() */
/*--------------------------------------------------------------------------