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
This commit is contained in:
Tomas Babej 2014-04-01 12:48:57 +02:00 committed by Martin Kosek
parent 2b171d273f
commit 5a0d52b939

View File

@ -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;