r14345: Fix Coverity #71. We don't currently propagate *any*
authorJeremy Allison <jra@samba.org>
Mon, 13 Mar 2006 21:11:15 +0000 (21:11 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 16:15:26 +0000 (11:15 -0500)
alloc error back up the stack from smbldap_set_mod()
so ensure we abort correctly.
Jeremy.
(This used to be commit 9a1e35079af9404e1775e2a098990277b3771086)

source3/lib/smbldap.c

index 327c5a7c4de6a5ed12121cd4d71d91e713d12802..a81829b3313a801ba9a025a9d61bafba2f47e258 100644 (file)
@@ -408,8 +408,9 @@ ATTRIB_MAP_ENTRY sidmap_attr_list[] = {
        if (mods == NULL) {
                mods = SMB_MALLOC_P(LDAPMod *);
                if (mods == NULL) {
-                       DEBUG(0, ("make_a_mod: out of memory!\n"));
-                       return;
+                       smb_panic("smbldap_set_mod: out of memory!\n");
+                       /* notreached. */
+                       abort();
                }
                mods[0] = NULL;
        }
@@ -422,13 +423,15 @@ ATTRIB_MAP_ENTRY sidmap_attr_list[] = {
        if (mods[i] == NULL) {
                mods = SMB_REALLOC_ARRAY (mods, LDAPMod *, i + 2);
                if (mods == NULL) {
-                       DEBUG(0, ("make_a_mod: out of memory!\n"));
-                       return;
+                       smb_panic("smbldap_set_mod: out of memory!\n");
+                       /* notreached. */
+                       abort();
                }
                mods[i] = SMB_MALLOC_P(LDAPMod);
                if (mods[i] == NULL) {
-                       DEBUG(0, ("make_a_mod: out of memory!\n"));
-                       return;
+                       smb_panic("smbldap_set_mod: out of memory!\n");
+                       /* notreached. */
+                       abort();
                }
                mods[i]->mod_op = modop;
                mods[i]->mod_values = NULL;
@@ -446,13 +449,15 @@ ATTRIB_MAP_ENTRY sidmap_attr_list[] = {
                mods[i]->mod_values = SMB_REALLOC_ARRAY(mods[i]->mod_values, char *, j + 2);
                                               
                if (mods[i]->mod_values == NULL) {
-                       DEBUG (0, ("make_a_mod: Memory allocation failure!\n"));
-                       return;
+                       smb_panic("smbldap_set_mod: out of memory!\n");
+                       /* notreached. */
+                       abort();
                }
 
                if (push_utf8_allocate(&utf8_value, value) == (size_t)-1) {
-                       DEBUG (0, ("make_a_mod: String conversion failure!\n"));
-                       return;
+                       smb_panic("smbldap_set_mod: String conversion failure!\n");
+                       /* notreached. */
+                       abort();
                }
 
                mods[i]->mod_values[j] = utf8_value;