From 5fd72e46773800cc556c342583c2ef9212adb2dd Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Sat, 16 Jan 2016 02:18:33 +0100 Subject: Do not free the return value of slapi_attr_get_valueset slapi_attr_get_valueset returns a pointer from the Slapi_Attr* argument. If you free the Slapi_ValueSet and the Slapi_Attr structures the valuesset is freed twice and this causes memory corruption and segfaults later. --- service_passwords.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/service_passwords.c b/service_passwords.c index a1d8f6d..316cfc7 100644 --- a/service_passwords.c +++ b/service_passwords.c @@ -108,12 +108,9 @@ static int dn_contains_uid(const char *dn) if (rc != 0 || slapi_valueset_count(uid_values) == 0) { /* empty uid value */ rc = 1; - goto fail2; + goto fail1; } -fail2: - slapi_valueset_free(uid_values); - fail1: slapi_entry_free(entry); -- cgit v1.2.3-1-g7c22