summaryrefslogtreecommitdiff
path: root/source3/param
diff options
context:
space:
mode:
Diffstat (limited to 'source3/param')
-rw-r--r--source3/param/loadparm.c4
-rw-r--r--source3/param/params.c14
2 files changed, 8 insertions, 10 deletions
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index 64b3ecd81b..8b79ec37d7 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -2470,7 +2470,7 @@ static int add_a_service(const service *pservice, const char *name)
service **tsp;
int *tinvalid;
- tsp = SMB_REALLOC_ARRAY(ServicePtrs, service *, num_to_alloc);
+ tsp = SMB_REALLOC_ARRAY_KEEP_OLD_ON_ERROR(ServicePtrs, service *, num_to_alloc);
if (tsp == NULL) {
DEBUG(0,("add_a_service: failed to enlarge ServicePtrs!\n"));
return (-1);
@@ -2484,7 +2484,7 @@ static int add_a_service(const service *pservice, const char *name)
iNumServices++;
/* enlarge invalid_services here for now... */
- tinvalid = SMB_REALLOC_ARRAY(invalid_services, int,
+ tinvalid = SMB_REALLOC_ARRAY_KEEP_OLD_ON_ERROR(invalid_services, int,
num_to_alloc);
if (tinvalid == NULL) {
DEBUG(0,("add_a_service: failed to enlarge "
diff --git a/source3/param/params.c b/source3/param/params.c
index f5ce6bdb64..6669e80191 100644
--- a/source3/param/params.c
+++ b/source3/param/params.c
@@ -262,10 +262,8 @@ static BOOL Section( myFILE *InFile, BOOL (*sfunc)(const char *) )
while( (EOF != c) && (c > 0) ) {
/* Check that the buffer is big enough for the next character. */
if( i > (bSize - 2) ) {
- char *tb;
-
- tb = (char *)SMB_REALLOC( bufr, bSize +BUFR_INC );
- if( NULL == tb ) {
+ char *tb = (char *)SMB_REALLOC_KEEP_OLD_ON_ERROR( bufr, bSize +BUFR_INC );
+ if(!tb) {
DEBUG(0, ("%s Memory re-allocation failure.", func) );
return False;
}
@@ -356,8 +354,8 @@ static BOOL Parameter( myFILE *InFile, BOOL (*pfunc)(const char *, const char *)
/* Loop until we've found the start of the value. */
if( i > (bSize - 2) ) {
/* Ensure there's space for next char. */
- char *tb = (char *)SMB_REALLOC( bufr, bSize + BUFR_INC );
- if( NULL == tb ) {
+ char *tb = (char *)SMB_REALLOC_KEEP_OLD_ON_ERROR( bufr, bSize + BUFR_INC );
+ if (!tb) {
DEBUG(0, ("%s Memory re-allocation failure.", func) );
return False;
}
@@ -414,8 +412,8 @@ static BOOL Parameter( myFILE *InFile, BOOL (*pfunc)(const char *, const char *)
while( (EOF !=c) && (c > 0) ) {
if( i > (bSize - 2) ) {
/* Make sure there's enough room. */
- char *tb = (char *)SMB_REALLOC( bufr, bSize + BUFR_INC );
- if( NULL == tb ) {
+ char *tb = (char *)SMB_REALLOC_KEEP_OLD_ON_ERROR( bufr, bSize + BUFR_INC );
+ if (!tb) {
DEBUG(0, ("%s Memory re-allocation failure.", func));
return False;
}