From: Douglas Bagnall Date: Thu, 5 Jan 2017 20:49:38 +0000 (+1300) Subject: replmd: rearrange nothing-to-delete logic X-Git-Tag: talloc-2.1.9~238 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=95bc1e0640c6071e451b2a029c91fa18a3db0294;p=thirdparty%2Fsamba.git replmd: rearrange nothing-to-delete logic Signed-off-by: Douglas Bagnall 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 d818faebdf3..1f15ae70ab4 100644 --- a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c +++ b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c @@ -2599,13 +2599,12 @@ static int replmd_modify_la_delete(struct ldb_module *module, unix_to_nt_time(&now, t); - /* check if there is nothing to delete */ - if ((!old_el || old_el->num_values == 0) && - el->num_values == 0) { - return LDB_SUCCESS; - } - - if (!old_el || old_el->num_values == 0) { + if (old_el == NULL || old_el->num_values == 0) { + /* there is nothing to delete... */ + if (el->num_values == 0) { + /* and we're deleting nothing, so that's OK */ + return LDB_SUCCESS; + } return LDB_ERR_NO_SUCH_ATTRIBUTE; }