From 404567ce6466d3cf04743f2dc1cdf15568b01a5d Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Wed, 10 Dec 2003 13:31:39 -0500 Subject: [svn-r7924] Purpose: Code cleanup Description: Add more assertions to detect attempted allocations of zero-sized blocks. Platforms tested: FreeBSD 4.9 (sleipnir) w & w/o parallel too minor to require h5committest --- src/H5FL.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/H5FL.c b/src/H5FL.c index 0224b3e..b8bc04e 100644 --- a/src/H5FL.c +++ b/src/H5FL.c @@ -752,6 +752,7 @@ H5FL_blk_malloc(H5FL_blk_head_t *head, size_t size) /* Double check parameters */ assert(head); + assert(size); /* Make certain the list is initialized first */ if(!head->init) @@ -828,6 +829,7 @@ H5FL_blk_calloc(H5FL_blk_head_t *head, size_t size) /* Double check parameters */ assert(head); + assert(size); /* Allocate the block */ if (NULL==(ret_value = H5FL_blk_malloc(head,size))) @@ -942,6 +944,7 @@ H5FL_blk_realloc(H5FL_blk_head_t *head, void *block, size_t new_size) /* Double check parameters */ assert(head); + assert(new_size); /* Check if we are actually re-allocating a block */ if(block!=NULL) { @@ -1303,6 +1306,7 @@ H5FL_arr_malloc(H5FL_arr_head_t *head, size_t elem) /* Double check parameters */ assert(head); + assert(elem); /* Make certain the list is initialized first */ if(!head->init) @@ -1387,6 +1391,7 @@ H5FL_arr_calloc(H5FL_arr_head_t *head, size_t elem) /* Double check parameters */ assert(head); + assert(elem); /* Allocate the array */ if (NULL==(ret_value = H5FL_arr_malloc(head,elem))) @@ -1426,6 +1431,7 @@ H5FL_arr_realloc(H5FL_arr_head_t *head, void * obj, size_t new_elem) /* Double check parameters */ assert(head); + assert(new_elem); /* Check if we are really allocating the object */ if(obj==NULL) { -- cgit v0.12