diff options
author | Andreas Schneider <asn@samba.org> | 2012-12-13 17:48:45 +0100 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2012-12-21 13:55:59 +0100 |
commit | ae6947cc48d032ad8af76f8a9e3dbae6a074d10e (patch) | |
tree | eb46d0794873dbc0b1d9666082bfd94f23cc792b /source4/lib | |
parent | a3bbf1bf3460034028516c1c0fced01db0cecd0c (diff) | |
download | samba-ae6947cc48d032ad8af76f8a9e3dbae6a074d10e.tar.gz samba-ae6947cc48d032ad8af76f8a9e3dbae6a074d10e.tar.bz2 samba-ae6947cc48d032ad8af76f8a9e3dbae6a074d10e.zip |
s4-regsitry: Check return value of ldb_msg_add_empty().
Found by Coverity.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
Diffstat (limited to 'source4/lib')
-rw-r--r-- | source4/lib/registry/ldb.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/source4/lib/registry/ldb.c b/source4/lib/registry/ldb.c index 0f0ddf9154..d1a8963fa2 100644 --- a/source4/lib/registry/ldb.c +++ b/source4/lib/registry/ldb.c @@ -646,8 +646,14 @@ static WERROR ldb_del_value(TALLOC_CTX *mem_ctx, struct hive_key *key, W_ERROR_HAVE_NO_MEMORY(msg); msg->dn = ldb_dn_copy(msg, kd->dn); W_ERROR_HAVE_NO_MEMORY(msg->dn); - ldb_msg_add_empty(msg, "data", LDB_FLAG_MOD_DELETE, NULL); + ret = ldb_msg_add_empty(msg, "data", LDB_FLAG_MOD_DELETE, NULL); + if (ret != LDB_SUCCESS) { + return WERR_FOOBAR; + } ldb_msg_add_empty(msg, "type", LDB_FLAG_MOD_DELETE, NULL); + if (ret != LDB_SUCCESS) { + return WERR_FOOBAR; + } ret = ldb_modify(kd->ldb, msg); |