diff options
Diffstat (limited to 'source/passdb/ldap.c')
-rw-r--r-- | source/passdb/ldap.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/source/passdb/ldap.c b/source/passdb/ldap.c index ff424b80e53..5efce453b2c 100644 --- a/source/passdb/ldap.c +++ b/source/passdb/ldap.c @@ -387,6 +387,11 @@ static void make_a_mod(LDAPMod ***modlist,int modop, char *attribute, char *valu if (mods == NULL) { mods = (LDAPMod **)malloc( sizeof(LDAPMod *) ); + if (mods == NULL) + { + DEBUG(0,("make_a_mod: out of memory!\n")); + return; + } mods[0] = NULL; } @@ -402,7 +407,17 @@ static void make_a_mod(LDAPMod ***modlist,int modop, char *attribute, char *valu if (mods[i] == NULL) { mods = (LDAPMod **)realloc( mods, (i+2) * sizeof( LDAPMod * ) ); + if (mods == NULL) + { + DEBUG(0,("make_a_mod: out of memory!\n")); + return; + } mods[i] = (LDAPMod *)malloc( sizeof( LDAPMod ) ); + if (mods[i] == NULL) + { + DEBUG(0,("make_a_mod: out of memory!\n")); + return; + } mods[i]->mod_op = modop; mods[i]->mod_values = NULL; mods[i]->mod_type = strdup( attribute ); |