From 7c45bd3a47fc2b24c5f1351a241ace2201c857d2 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 6 Apr 2007 21:55:44 +0000 Subject: r22112: Fix memleak pointed out by Steven Danneman . Jeremy. --- source/libads/ldap.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source/libads') diff --git a/source/libads/ldap.c b/source/libads/ldap.c index 1d08a01a263..b2ca68f67fe 100644 --- a/source/libads/ldap.c +++ b/source/libads/ldap.c @@ -2258,7 +2258,6 @@ int ads_count_replies(ADS_STRUCT *ads, void *res) LDAPMessage *msg, const char *field, SEC_DESC **sd) { struct berval **values; - prs_struct ps; BOOL ret = False; values = ldap_get_values_len(ads->ld, msg, field); @@ -2266,11 +2265,13 @@ int ads_count_replies(ADS_STRUCT *ads, void *res) if (!values) return False; if (values[0]) { + prs_struct ps; prs_init(&ps, values[0]->bv_len, mem_ctx, UNMARSHALL); prs_copy_data_in(&ps, values[0]->bv_val, values[0]->bv_len); prs_set_offset(&ps,0); ret = sec_io_desc("sd", sd, &ps, 1); + prs_mem_free(&ps); } ldap_value_free_len(values); -- cgit