ldb:ldb_dn.c - "ldb_dn_set_extended_component" - free the linearized string when...
authorMatthias Dieter Wallnöfer <mdw@samba.org>
Tue, 29 Jun 2010 20:07:51 +0000 (22:07 +0200)
committerMatthias Dieter Wallnöfer <mdw@samba.org>
Tue, 29 Jun 2010 20:07:51 +0000 (22:07 +0200)
source4/lib/ldb/common/ldb_dn.c

index c4805f7243b7eed0273125b83317d97eafcb69f0..11de31ed6b0fcdfc3b9fdad4643401469f511c09 100644 (file)
@@ -1925,7 +1925,6 @@ int ldb_dn_set_extended_component(struct ldb_dn *dn,
                                        ldb_dn_mark_invalid(dn);
                                        return LDB_ERR_OPERATIONS_ERROR;
                                }
-                               return LDB_SUCCESS;
                        } else {
                                if (i != (dn->ext_comp_num - 1)) {
                                        memmove(&dn->ext_components[i],
@@ -1943,9 +1942,10 @@ int ldb_dn_set_extended_component(struct ldb_dn *dn,
                                        ldb_dn_mark_invalid(dn);
                                        return LDB_ERR_OPERATIONS_ERROR;
                                }
-                               return LDB_SUCCESS;
                        }
                        LDB_FREE(dn->ext_linearized);
+
+                       return LDB_SUCCESS;
                }
        }
 
@@ -1976,6 +1976,8 @@ int ldb_dn_set_extended_component(struct ldb_dn *dn,
        dn->ext_components = p;
        dn->ext_comp_num++;
 
+       LDB_FREE(dn->ext_linearized);
+
        return LDB_SUCCESS;
 }