summaryrefslogtreecommitdiffstats
path: root/source/lib
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
commit94128f9f372c23602c14cf13a79a24d01065ced1 (patch)
tree152a26139ca453bac087bf4d658a813527f270a8 /source/lib
parent9cabc3fd63d7780eb5d80eb7619fd7606d9da3b8 (diff)
downloadsamba-94128f9f372c23602c14cf13a79a24d01065ced1.tar.gz
samba-94128f9f372c23602c14cf13a79a24d01065ced1.tar.xz
samba-94128f9f372c23602c14cf13a79a24d01065ced1.zip
More Realloc fixes.
Jeremy.
Diffstat (limited to 'source/lib')
-rw-r--r--source/lib/util_array.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/source/lib/util_array.c b/source/lib/util_array.c
index dcb08d9ce75..8ad8da61c31 100644
--- a/source/lib/util_array.c
+++ b/source/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;
}