r21281: move constinancy checks to the beginning of the function
authorStefan Metzmacher <metze@samba.org>
Sun, 11 Feb 2007 17:36:33 +0000 (17:36 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 19:44:58 +0000 (14:44 -0500)
metze

source/dsdb/repl/replicated_objects.c

index 9a9fd40d4b12e1e1e98c6f500906fd9ef898efce..9f6ce4c519b2024d7bb71dd293db8ce99f2bd8a5 100644 (file)
@@ -61,6 +61,14 @@ static WERROR dsdb_convert_object(struct ldb_context *ldb,
                return WERR_FOOBAR;
        }
 
+       if (in->object.attribute_ctr.num_attributes != 0 && !in->meta_data_ctr) {
+               return WERR_FOOBAR;
+       }
+
+       if (in->object.attribute_ctr.num_attributes != in->meta_data_ctr->count) {
+               return WERR_FOOBAR;
+       }
+
        msg = ldb_msg_new(mem_ctx);
        W_ERROR_HAVE_NO_MEMORY(msg);
 
@@ -87,14 +95,6 @@ static WERROR dsdb_convert_object(struct ldb_context *ldb,
                W_ERROR_NOT_OK_RETURN(status);
        }
 
-       if (in->object.attribute_ctr.num_attributes != 0 && !in->meta_data_ctr) {
-               return WERR_FOOBAR;
-       }
-
-       if (in->object.attribute_ctr.num_attributes != in->meta_data_ctr->count) {
-               return WERR_FOOBAR;
-       }
-
        md = talloc(mem_ctx, struct replPropertyMetaDataBlob);
        W_ERROR_HAVE_NO_MEMORY(md);