s4-rootdse: setup length after NULL check
authorAndrew Tridgell <tridge@samba.org>
Fri, 10 Sep 2010 10:16:14 +0000 (20:16 +1000)
committerAndrew Tridgell <tridge@samba.org>
Wed, 15 Sep 2010 05:39:34 +0000 (15:39 +1000)
source4/dsdb/samdb/ldb_modules/rootdse.c

index 248a7203c8e214d3551d08e08aa692d33755f4e9..2e7c97af386984a499b83bd29055e0b6b297bb72 100644 (file)
@@ -146,12 +146,12 @@ static int expand_dn_in_message(struct ldb_module *module, struct ldb_message *m
        dn2 = res->msgs[0]->dn;
 
        v->data = (uint8_t *)ldb_dn_get_extended_linearized(msg->elements, dn2, edn_type);
-       v->length = strlen((char *)v->data);
-
        if (v->data == NULL) {
                talloc_free(tmp_ctx);
                return ldb_operr(ldb);
        }
+       v->length = strlen((char *)v->data);
+
 
        talloc_free(tmp_ctx);