diff options
author | Simo Sorce <idra@samba.org> | 2001-08-12 17:30:01 +0000 |
---|---|---|
committer | Simo Sorce <idra@samba.org> | 2001-08-12 17:30:01 +0000 |
commit | fa8e55b8b465114ce209344965c1ca0333b84db9 (patch) | |
tree | f0e4646dc69b270cbdcf1147ff911182669afbc7 /source/aparser | |
parent | 895d1cd317d0838d711474f2f19186444a88b52c (diff) | |
download | samba-fa8e55b8b465114ce209344965c1ca0333b84db9.tar.gz samba-fa8e55b8b465114ce209344965c1ca0333b84db9.tar.xz samba-fa8e55b8b465114ce209344965c1ca0333b84db9.zip |
this is a big global fix for the ptr = Realloc(ptr, size) bug.
many possible mem leaks, and segfaults fixed.
someone should port this fix to 2.2 also.
Diffstat (limited to 'source/aparser')
-rw-r--r-- | source/aparser/parser.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/source/aparser/parser.c b/source/aparser/parser.c index c2348b84f96..0c7153e1fb7 100644 --- a/source/aparser/parser.c +++ b/source/aparser/parser.c @@ -460,8 +460,12 @@ realloc some memory for a parse structure ********************************************************************/ BOOL io_realloc(char *name, io_struct *ps, void **ptr, unsigned size) { - (*ptr) = (void *)Realloc(*ptr, size); - if (*ptr) return True; - return False; + BOOL ret = True; + void *tp; + + tp = (void *)Realloc(*ptr, size); + if (tp) *ptr = tp; + else ret = False; + return ret; } |