diff options
author | Jeremy Allison <jra@samba.org> | 2001-08-19 17:44:20 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2001-08-19 17:44:20 +0000 |
commit | 4d693f881502fa7cf3b2649a7a5115f261cb4715 (patch) | |
tree | 3ce0d1dc2ee6b7058504729302670668be749bda /source/lib/util.c | |
parent | 49b417b333fbba01604c13f12bbff864f9e0db37 (diff) | |
download | samba-4d693f881502fa7cf3b2649a7a5115f261cb4715.tar.gz samba-4d693f881502fa7cf3b2649a7a5115f261cb4715.tar.xz samba-4d693f881502fa7cf3b2649a7a5115f261cb4715.zip |
More Realloc fixes.
Jeremy.
Diffstat (limited to 'source/lib/util.c')
-rw-r--r-- | source/lib/util.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/source/lib/util.c b/source/lib/util.c index fd1299701e7..db87cfefa59 100644 --- a/source/lib/util.c +++ b/source/lib/util.c @@ -157,20 +157,21 @@ char *get_numlist(char *p, uint32 **num, int *count) int val; if (num == NULL || count == NULL) - { return NULL; - } (*count) = 0; (*num ) = NULL; - while ((p = Atoic(p, &val, ":,")) != NULL && (*p) != ':') - { - (*num) = Realloc((*num), ((*count)+1) * sizeof(uint32)); - if ((*num) == NULL) - { + while ((p = Atoic(p, &val, ":,")) != NULL && (*p) != ':') { + uint32 *tn; + + tn = Realloc((*num), ((*count)+1) * sizeof(uint32)); + if (tn == NULL) { + if (*num) + free(*num); return NULL; - } + } else + (*num) = tn; (*num)[(*count)] = val; (*count)++; p++; |