diff options
author | Jeremy Allison <jra@samba.org> | 2001-08-18 19:43:24 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2001-08-18 19:43:24 +0000 |
commit | a6785bac152bf03db3670f6372b37f4cd5f9fd7a (patch) | |
tree | 4ebbbe4d856e27f69df599ae904d3af5790bdfd7 /source/param/params.c | |
parent | a2ccf53229cf9400bf43b4e8128a74669a3970f7 (diff) | |
download | samba-a6785bac152bf03db3670f6372b37f4cd5f9fd7a.tar.gz samba-a6785bac152bf03db3670f6372b37f4cd5f9fd7a.tar.xz samba-a6785bac152bf03db3670f6372b37f4cd5f9fd7a.zip |
More Realloc fixes.
Jeremy.
Diffstat (limited to 'source/param/params.c')
-rw-r--r-- | source/param/params.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/source/param/params.c b/source/param/params.c index b359b269d4e..2bc32f1c66d 100644 --- a/source/param/params.c +++ b/source/param/params.c @@ -252,13 +252,16 @@ static BOOL Section( myFILE *InFile, BOOL (*sfunc)(char *) ) /* Check that the buffer is big enough for the next character. */ if( i > (bSize - 2) ) { - bSize += BUFR_INC; - bufr = Realloc( bufr, bSize ); - if( NULL == bufr ) + char *tb; + + tb = Realloc( bufr, bSize +BUFR_INC ); + if( NULL == tb ) { DEBUG(0, ("%s Memory re-allocation failure.", func) ); return( False ); } + bufr = tb; + bSize += BUFR_INC; } /* Handle a single character. */ @@ -346,13 +349,16 @@ static BOOL Parameter( myFILE *InFile, BOOL (*pfunc)(char *, char *), int c ) if( i > (bSize - 2) ) /* Ensure there's space for next char. */ { - bSize += BUFR_INC; - bufr = Realloc( bufr, bSize ); - if( NULL == bufr ) + char *tb; + + tb = Realloc( bufr, bSize + BUFR_INC ); + if( NULL == tb ) { DEBUG(0, ("%s Memory re-allocation failure.", func) ); return( False ); } + bufr = tb; + bSize += BUFR_INC; } switch( c ) |