From 5a0d52b9393a2a4f154aca617855cba3f83e989b Mon Sep 17 00:00:00 2001 From: Tomas Babej Date: Tue, 1 Apr 2014 12:48:57 +0200 Subject: [PATCH] ipa-pwd-extop: Fix memory leak in ipapwd_pre_bind We need to free the entry before returning from the function. https://fedorahosted.org/freeipa/ticket/4295 --- daemons/ipa-slapi-plugins/ipa-pwd-extop/prepost.c | 1 + 1 file changed, 1 insertion(+) diff --git a/daemons/ipa-slapi-plugins/ipa-pwd-extop/prepost.c b/daemons/ipa-slapi-plugins/ipa-pwd-extop/prepost.c index c6e7509bb..def312ca8 100644 --- a/daemons/ipa-slapi-plugins/ipa-pwd-extop/prepost.c +++ b/daemons/ipa-slapi-plugins/ipa-pwd-extop/prepost.c @@ -1414,6 +1414,7 @@ static int ipapwd_pre_bind(Slapi_PBlock *pb) /* Try to do OTP first. */ syncreq = sync_request_present(pb); if (!syncreq && !ipapwd_pre_bind_otp(dn, entry, credentials)) { + slapi_entry_free(entry); slapi_send_ldap_result(pb, LDAP_INVALID_CREDENTIALS, NULL, NULL, 0, NULL); return 1;