s4:ldb - "ldb_dn_update_components" - fix free of invalid DN parts
authorMatthias Dieter Wallnöfer <mdw@samba.org>
Tue, 29 Jun 2010 20:10:14 +0000 (22:10 +0200)
committerMatthias Dieter Wallnöfer <mdw@samba.org>
Tue, 29 Jun 2010 20:13:05 +0000 (22:13 +0200)
Use "LDB_FREE" for such free operations and in addition wipe also the casefolded
DN out.

source4/lib/ldb/common/ldb_dn.c

index 11de31ed6b0fcdfc3b9fdad4643401469f511c09..f81f1a4d932b94f26be88ebc349a4e12ddd4e7e0 100644 (file)
@@ -2037,10 +2037,9 @@ int ldb_dn_update_components(struct ldb_dn *dn, const struct ldb_dn *ref_dn)
               sizeof(struct ldb_dn_component)*ref_dn->comp_num);
        dn->comp_num = ref_dn->comp_num;
 
-       talloc_free(dn->linearized);
-       talloc_free(dn->ext_linearized);
-       dn->ext_linearized = NULL;
-       dn->linearized = NULL;
+       LDB_FREE(dn->casefold);
+       LDB_FREE(dn->linearized);
+       LDB_FREE(dn->ext_linearized);
 
        return LDB_SUCCESS;
 }