diff options
author | Jeremy Allison <jra@samba.org> | 2006-03-13 21:11:15 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2006-03-13 21:11:15 +0000 |
commit | 1785240d38a8c37164d8027f922049e4e9380761 (patch) | |
tree | 51588529d903ded3ebae393da9a5fa705c3ab8d8 | |
parent | e14e4db47d7a4b10600c42351c909eda651df44a (diff) | |
download | samba-1785240d38a8c37164d8027f922049e4e9380761.tar.gz samba-1785240d38a8c37164d8027f922049e4e9380761.tar.xz samba-1785240d38a8c37164d8027f922049e4e9380761.zip |
r14345: Fix Coverity #71. We don't currently propagate *any*
alloc error back up the stack from smbldap_set_mod()
so ensure we abort correctly.
Jeremy.
-rw-r--r-- | source/lib/smbldap.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/source/lib/smbldap.c b/source/lib/smbldap.c index 327c5a7c4de..a81829b3313 100644 --- a/source/lib/smbldap.c +++ b/source/lib/smbldap.c @@ -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; |