s4-objectclass Use a specific local variable name, not 'value'
authorAndrew Bartlett <abartlet@samba.org>
Thu, 25 Nov 2010 23:10:01 +0000 (10:10 +1100)
committerMatthias Dieter Wallnöfer <mdw@samba.org>
Fri, 26 Nov 2010 12:09:59 +0000 (13:09 +0100)
This makes it clearer what the local variable in use here does.

Andrew Bartlett

Signed-off-by: Matthias Dieter Wallnöfer <mdw@samba.org>
source4/dsdb/samdb/ldb_modules/objectclass.c

index 21f316400a3c3d68b2899ca6da63154ff9dad108..0eceaefce4a15a45824e1e45ac34ec18637552e4 100644 (file)
@@ -389,6 +389,7 @@ static int objectclass_add(struct ldb_module *module, struct ldb_request *req)
                instanceType = ldb_msg_find_attr_as_uint(req->op.add.message,
                                                         "instanceType", 0);
                if (!(instanceType & INSTANCE_TYPE_IS_NC_HEAD)) {
                instanceType = ldb_msg_find_attr_as_uint(req->op.add.message,
                                                         "instanceType", 0);
                if (!(instanceType & INSTANCE_TYPE_IS_NC_HEAD)) {
+                       char *referral_uri;
                        /* When we are trying to readd the root basedn then
                         * this is denied, but with an interesting mechanism:
                         * there is generated a referral with the last
                        /* When we are trying to readd the root basedn then
                         * this is denied, but with an interesting mechanism:
                         * there is generated a referral with the last
@@ -398,13 +399,13 @@ static int objectclass_add(struct ldb_module *module, struct ldb_request *req)
                        if (val == NULL) {
                                return ldb_operr(ldb);
                        }
                        if (val == NULL) {
                                return ldb_operr(ldb);
                        }
-                       value = talloc_asprintf(req, "ldap://%s/%s", val->data,
-                                               ldb_dn_get_linearized(req->op.add.message->dn));
-                       if (value == NULL) {
+                       referral_uri = talloc_asprintf(req, "ldap://%s/%s", val->data,
+                                                      ldb_dn_get_linearized(req->op.add.message->dn));
+                       if (referral_uri == NULL) {
                                return ldb_module_oom(module);
                        }
 
                                return ldb_module_oom(module);
                        }
 
-                       return ldb_module_send_referral(req, value);
+                       return ldb_module_send_referral(req, referral_uri);
                }
        }
 
                }
        }