dsdb/linked_attributes: initialise more pointers to NULL
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Tue, 26 Feb 2019 23:17:58 +0000 (12:17 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Mon, 4 Mar 2019 21:41:18 +0000 (21:41 +0000)
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source4/dsdb/samdb/ldb_modules/linked_attributes.c

index d0d560c2dd9a88b430e8c8f4a6ef420912249c15..86540988dc4f98c3f9aa76f2de332cbc7f33feb4 100644 (file)
@@ -947,7 +947,7 @@ static int linked_attributes_fix_links(struct ldb_module *module,
        unsigned int i;
        TALLOC_CTX *tmp_ctx = NULL;
        struct ldb_context *ldb = ldb_module_get_ctx(module);
-       const struct dsdb_attribute *target;
+       const struct dsdb_attribute *target = NULL;
        const char *attrs[2];
        int ret;
        struct la_private *la_private = NULL;
@@ -974,10 +974,10 @@ static int linked_attributes_fix_links(struct ldb_module *module,
        attrs[1] = NULL;
 
        for (i=0; i<el->num_values; i++) {
-               struct dsdb_dn *dsdb_dn;
-               struct ldb_result *res;
-               struct ldb_message *msg;
-               struct ldb_message_element *el2;
+               struct dsdb_dn *dsdb_dn = NULL;
+               struct ldb_result *res = NULL;
+               struct ldb_message *msg  = NULL;
+               struct ldb_message_element *el2 = NULL;
                struct GUID link_guid;
                char *link_guid_str = NULL;