replmd: rearrange nothing-to-delete logic
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Thu, 5 Jan 2017 20:49:38 +0000 (09:49 +1300)
committerDouglas Bagnall <dbagnall@samba.org>
Thu, 9 Feb 2017 02:17:16 +0000 (03:17 +0100)
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source4/dsdb/samdb/ldb_modules/repl_meta_data.c

index d818faebdf306955601b2d9b31e1f0eb849a5ae8..1f15ae70ab4b797cb9413e10995d24973a560e3b 100644 (file)
@@ -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;
        }