From 39ab7b8ebdefd13fb586d65da76173c0a3fa5fa5 Mon Sep 17 00:00:00 2001 From: Kamen Mazdrashki Date: Sat, 24 Oct 2009 00:02:24 +0300 Subject: s4/drs: Fix memory leek in prefixMap Signed-off-by: Stefan Metzmacher --- source4/dsdb/schema/schema_prefixmap.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'source4/dsdb') diff --git a/source4/dsdb/schema/schema_prefixmap.c b/source4/dsdb/schema/schema_prefixmap.c index 8173f89ece..08e51559d6 100644 --- a/source4/dsdb/schema/schema_prefixmap.c +++ b/source4/dsdb/schema/schema_prefixmap.c @@ -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 */ -- cgit