summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2006-03-13 21:11:15 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:15:26 -0500
commitf6071a90c723e95ed040231aa84b30e87e41e726 (patch)
treea1f986fd8106de3e880130bd4d6dcd331b3382fb /source3
parentca9be7c92b33c9b5de46f7b85754ef5f3c46f47c (diff)
downloadsamba-f6071a90c723e95ed040231aa84b30e87e41e726.tar.gz
samba-f6071a90c723e95ed040231aa84b30e87e41e726.tar.bz2
samba-f6071a90c723e95ed040231aa84b30e87e41e726.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. (This used to be commit 9a1e35079af9404e1775e2a098990277b3771086)
Diffstat (limited to 'source3')
-rw-r--r--source3/lib/smbldap.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/source3/lib/smbldap.c b/source3/lib/smbldap.c
index 327c5a7c4d..a81829b331 100644
--- a/source3/lib/smbldap.c
+++ b/source3/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;