s4:dsdb - fix up warnings
authorMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>
Tue, 16 Mar 2010 08:48:58 +0000 (09:48 +0100)
committerMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>
Tue, 16 Mar 2010 08:50:39 +0000 (09:50 +0100)
source4/dsdb/samdb/ldb_modules/linked_attributes.c
source4/dsdb/samdb/ldb_modules/resolve_oids.c

index 1e0a2b05f357cc3ac5b5bbc872e9dab9a2648984..56ed447771e1e3a58f5daf755b6d10869e535178 100644 (file)
@@ -163,7 +163,7 @@ static int linked_attributes_rename(struct ldb_module *module, struct ldb_reques
 
        schema = dsdb_get_schema(ldb, res);
        if (!schema) {
-               ldb_oom(schema);
+               ldb_oom(ldb);
                return LDB_ERR_OPERATIONS_ERROR;
        }
 
index aab997d996e5730717c703a82183542d758cd38d..99289453754e1fa68d8cdfa25f1f04af9a70d681 100644 (file)
@@ -521,7 +521,10 @@ static int resolve_oids_search(struct ldb_module *module, struct ldb_request *re
                return LDB_ERR_OPERATIONS_ERROR;
        }
 
-       talloc_reference(tree, schema);
+       if (talloc_reference(tree, schema) == NULL) {
+               ldb_oom(ldb);
+               return LDB_ERR_OPERATIONS_ERROR;
+       }
 
        ret = resolve_oids_parse_tree_replace(ldb, schema,
                                              tree);
@@ -529,7 +532,8 @@ static int resolve_oids_search(struct ldb_module *module, struct ldb_request *re
                return ret;
        }
 
-       attrs2 = str_list_copy_const(ac, req->op.search.attrs);
+       attrs2 = str_list_copy_const(ac,
+                                    discard_const_p(const char *, req->op.search.attrs));
        if (req->op.search.attrs && !attrs2) {
                ldb_oom(ldb);
                return LDB_ERR_OPERATIONS_ERROR;
@@ -537,7 +541,7 @@ static int resolve_oids_search(struct ldb_module *module, struct ldb_request *re
 
        for (i=0; attrs2 && attrs2[i]; i++) {
                const char *p;
-               struct dsdb_attribute *a;
+               const struct dsdb_attribute *a;
 
                p = strchr(attrs2[i], '.');
                if (p == NULL) {