summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>1999-02-03 21:04:38 +0000
committerJeremy Allison <jra@samba.org>1999-02-03 21:04:38 +0000
commit72f989fa514d71def76410d755fed4f43ca3759e (patch)
treea6158540380be00abb26eb8c1b6f749eb1b96c2b
parent87dc4ff92fac7f4f74339180735e2a1132c63fb6 (diff)
downloadsamba-72f989fa514d71def76410d755fed4f43ca3759e.tar.gz
samba-72f989fa514d71def76410d755fed4f43ca3759e.tar.xz
samba-72f989fa514d71def76410d755fed4f43ca3759e.zip
A couple of malloc fail catches.
Jeremy.
-rw-r--r--source/passdb/ldap.c5
-rw-r--r--source/printing/print_svid.c5
2 files changed, 9 insertions, 1 deletions
diff --git a/source/passdb/ldap.c b/source/passdb/ldap.c
index 5efce453b2c..bb05d211e48 100644
--- a/source/passdb/ldap.c
+++ b/source/passdb/ldap.c
@@ -433,6 +433,11 @@ static void make_a_mod(LDAPMod ***modlist,int modop, char *attribute, char *valu
}
mods[ i ]->mod_values = (char **)realloc(mods[ i ]->mod_values,
(j+2) * sizeof( char * ));
+ if ( mods[ i ]->mod_values == NULL)
+ {
+ DEBUG(0, "make_a_mod: Memory allocation failure!\n");
+ return;
+ }
mods[ i ]->mod_values[ j ] = strdup(value);
mods[ i ]->mod_values[ j + 1 ] = NULL;
}
diff --git a/source/printing/print_svid.c b/source/printing/print_svid.c
index 2b615a5c49f..85eaf8f95dd 100644
--- a/source/printing/print_svid.c
+++ b/source/printing/print_svid.c
@@ -79,9 +79,12 @@ static void populate_printers(void)
/* add it to the cache */
if ((ptmp = malloc(sizeof (*ptmp))) != NULL) {
ZERO_STRUCTP(ptmp);
- ptmp->name = strdup(name);
+ if((ptmp->name = strdup(name)) == NULL)
+ DEBUG(0,("populate_printers: malloc fail in strdup !\n"));
ptmp->next = printers;
printers = ptmp;
+ } else {
+ DEBUG(0,("populate_printers: malloc fail for ptmp\n"));
}
}
pclose(fp);