summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2001-08-19 17:42:34 +0000
committerJeremy Allison <jra@samba.org>2001-08-19 17:42:34 +0000
commite47cac8db4b212cbd14110ae379a95abd31f8e54 (patch)
tree9a5864ee683eddb7e4bdc609a727fa28344f8dd7
parent9326b82ffa255196ab68a23bf3f4ff14a7fd9bda (diff)
downloadsamba-e47cac8db4b212cbd14110ae379a95abd31f8e54.tar.gz
samba-e47cac8db4b212cbd14110ae379a95abd31f8e54.tar.bz2
samba-e47cac8db4b212cbd14110ae379a95abd31f8e54.zip
More Realloc fixes.
Jeremy. (This used to be commit 94128f9f372c23602c14cf13a79a24d01065ced1)
-rw-r--r--source3/lib/util_array.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/source3/lib/util_array.c b/source3/lib/util_array.c
index dcb08d9ce7..8ad8da61c3 100644
--- a/source3/lib/util_array.c
+++ b/source3/lib/util_array.c
@@ -61,18 +61,17 @@ void* add_item_to_array(uint32 *len, void ***array, void *item)
void **tary;
if (len == NULL || array == NULL)
- {
return NULL;
- }
tary = (void**)Realloc((*array), ((*len)+1)*sizeof((*array)[0]));
- if (tary != NULL)
- {
+ if (tary != NULL) {
(*array) = tary;
(*array)[(*len)] = item;
(*len)++;
return item;
+ } else {
+ free((char *)*array);
}
return NULL;
}