From: Joseph Sutton Date: Fri, 6 Oct 2023 01:07:41 +0000 (+1300) Subject: s4:dsdb: Check return value of ldb_msg_add_empty() (CID 1272827) X-Git-Tag: tevent-0.16.0~47 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d4042e880f62bc7e3f40576a0763073f8464bc2b;p=thirdparty%2Fsamba.git s4:dsdb: Check return value of ldb_msg_add_empty() (CID 1272827) Signed-off-by: Joseph Sutton Reviewed-by: Andrew Bartlett --- diff --git a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c index 7dcd5f879e0..7aec0063c96 100644 --- a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c +++ b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c @@ -3516,7 +3516,10 @@ static int replmd_modify_handle_linked_attribs(struct ldb_module *module, if (old_el) { ldb_msg_remove_attr(old_msg, el->name); } - ldb_msg_add_empty(old_msg, el->name, 0, &new_el); + ret = ldb_msg_add_empty(old_msg, el->name, 0, &new_el); + if (ret != LDB_SUCCESS) { + return ret; + } new_el->num_values = el->num_values; new_el->values = talloc_steal(msg->elements, el->values);