s4/drs: Fix memory leek in prefixMap
authorKamen Mazdrashki <kamen.mazdrashki@postpath.com>
Fri, 23 Oct 2009 21:02:24 +0000 (00:02 +0300)
committerStefan Metzmacher <metze@samba.org>
Fri, 6 Nov 2009 13:05:37 +0000 (14:05 +0100)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
source4/dsdb/schema/schema_prefixmap.c

index 8173f89ece58673d8ebc8e4153969ce71c0b34fb..08e51559d6a50bdfe60f63f425aaf5c216a244da 100644 (file)
@@ -155,7 +155,7 @@ WERROR dsdb_schema_pfm_make_attid(struct dsdb_schema_prefixmap *pfm, const char
        last_value = strtoul(last_subid, NULL, 10);
 
        /* encode oid in BER format */
-       if (!ber_write_OID_String(NULL, &bin_oid, oid)) {
+       if (!ber_write_OID_String(pfm, &bin_oid, oid)) {
                return WERR_INTERNAL_ERROR;
        }
 
@@ -186,6 +186,9 @@ WERROR dsdb_schema_pfm_make_attid(struct dsdb_schema_prefixmap *pfm, const char
                W_ERROR_NOT_OK_RETURN(werr);
 
                pfm_entry = &pfm->prefixes[idx];
+       } else {
+               /* free memory allocated for bin_oid */
+               data_blob_free(&bin_oid);
        }
 
        /* compose the attid */