summaryrefslogtreecommitdiff
path: root/source3/lib/ldb
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2006-10-24 20:20:39 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:15:39 -0500
commit3a22bdf89ee71a72dc3e84aee6e1d10474b8852b (patch)
tree0150822f57916cef90913138e7f68b5823575c83 /source3/lib/ldb
parent1fd4184da7b1f17a1f89b5963a8ad80174847155 (diff)
downloadsamba-3a22bdf89ee71a72dc3e84aee6e1d10474b8852b.tar.gz
samba-3a22bdf89ee71a72dc3e84aee6e1d10474b8852b.tar.bz2
samba-3a22bdf89ee71a72dc3e84aee6e1d10474b8852b.zip
r19486: Probably Coverity is wrong here, but this fixes their ID 317. Not sure whether
to merge it to 4_0. I want it in 3_0 because it took a bit to persuade myself that el can not be NULL here. Volker (This used to be commit c0c035b1c8b9d80cd205cde16ad3e838e2d44459)
Diffstat (limited to 'source3/lib/ldb')
-rw-r--r--source3/lib/ldb/common/ldb_msg.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source3/lib/ldb/common/ldb_msg.c b/source3/lib/ldb/common/ldb_msg.c
index 7e001f9180..0d9cb47882 100644
--- a/source3/lib/ldb/common/ldb_msg.c
+++ b/source3/lib/ldb/common/ldb_msg.c
@@ -209,7 +209,9 @@ int ldb_msg_add_steal_value(struct ldb_message *msg,
ret = ldb_msg_add_value(msg, attr_name, val);
if (ret == LDB_SUCCESS) {
struct ldb_message_element *el;
- el = ldb_msg_find_element(msg, attr_name);
+ if (!(el = ldb_msg_find_element(msg, attr_name))) {
+ return LDB_ERR_OPERATIONS_ERROR;
+ }
talloc_steal(el->values, val->data);
}
return ret;