|
|
e3ffab |
From 8ab479e0fdaa509775255005400b214736c3308c Mon Sep 17 00:00:00 2001
|
|
|
e3ffab |
From: Jan Cholasta <jcholast@redhat.com>
|
|
|
e3ffab |
Date: Wed, 5 Nov 2014 08:53:41 +0000
|
|
|
e3ffab |
Subject: [PATCH] Fix memory leak in ipa-pwd-extop
|
|
|
e3ffab |
|
|
|
e3ffab |
Also remove dead code and explicitly mark an ignored return value to prevent
|
|
|
e3ffab |
false positives in static code analysis.
|
|
|
e3ffab |
|
|
|
e3ffab |
https://fedorahosted.org/freeipa/ticket/4651
|
|
|
e3ffab |
|
|
|
e3ffab |
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
|
|
|
e3ffab |
---
|
|
|
e3ffab |
daemons/ipa-slapi-plugins/ipa-pwd-extop/ipa_pwd_extop.c | 3 +--
|
|
|
e3ffab |
daemons/ipa-slapi-plugins/ipa-pwd-extop/syncreq.c | 2 +-
|
|
|
e3ffab |
2 files changed, 2 insertions(+), 3 deletions(-)
|
|
|
e3ffab |
|
|
|
e3ffab |
diff --git a/daemons/ipa-slapi-plugins/ipa-pwd-extop/ipa_pwd_extop.c b/daemons/ipa-slapi-plugins/ipa-pwd-extop/ipa_pwd_extop.c
|
|
|
e3ffab |
index ca021cac71da690a498fe3003fae1babb30456c1..f0346a343188930dfc90e19d2e5d38cb30741b90 100644
|
|
|
e3ffab |
--- a/daemons/ipa-slapi-plugins/ipa-pwd-extop/ipa_pwd_extop.c
|
|
|
e3ffab |
+++ b/daemons/ipa-slapi-plugins/ipa-pwd-extop/ipa_pwd_extop.c
|
|
|
e3ffab |
@@ -1393,6 +1393,7 @@ done:
|
|
|
e3ffab |
if (rc != LDAP_SUCCESS) {
|
|
|
e3ffab |
free(password);
|
|
|
e3ffab |
free(svcname);
|
|
|
e3ffab |
+ free(enctypes);
|
|
|
e3ffab |
*_err_msg = err_msg;
|
|
|
e3ffab |
} else {
|
|
|
e3ffab |
*_password = password;
|
|
|
e3ffab |
@@ -1639,7 +1640,6 @@ static int ipapwd_getkeytab(Slapi_PBlock *pb, struct ipapwd_krbcfg *krbcfg)
|
|
|
e3ffab |
krb5_context krbctx = NULL;
|
|
|
e3ffab |
krb5_error_code krberr;
|
|
|
e3ffab |
struct berval *extop_value = NULL;
|
|
|
e3ffab |
- BerElement *ber = NULL;
|
|
|
e3ffab |
char *service_name = NULL;
|
|
|
e3ffab |
char *svcname;
|
|
|
e3ffab |
Slapi_Entry *target_entry = NULL;
|
|
|
e3ffab |
@@ -1827,7 +1827,6 @@ free_and_return:
|
|
|
e3ffab |
}
|
|
|
e3ffab |
free(svals);
|
|
|
e3ffab |
}
|
|
|
e3ffab |
- if (ber) ber_free(ber, 1);
|
|
|
e3ffab |
if (bvp) ber_bvfree(bvp);
|
|
|
e3ffab |
|
|
|
e3ffab |
return SLAPI_PLUGIN_EXTENDED_SENT_RESULT;
|
|
|
e3ffab |
diff --git a/daemons/ipa-slapi-plugins/ipa-pwd-extop/syncreq.c b/daemons/ipa-slapi-plugins/ipa-pwd-extop/syncreq.c
|
|
|
e3ffab |
index 2bfcf10a271a497741f08bb519020cd159eb4aeb..cbb4536e7d119f4550e4b523eb02e34d058ae7a1 100644
|
|
|
e3ffab |
--- a/daemons/ipa-slapi-plugins/ipa-pwd-extop/syncreq.c
|
|
|
e3ffab |
+++ b/daemons/ipa-slapi-plugins/ipa-pwd-extop/syncreq.c
|
|
|
e3ffab |
@@ -86,7 +86,7 @@ bool sync_request_handle(Slapi_ComponentId *plugin_id, Slapi_PBlock *pb,
|
|
|
e3ffab |
}
|
|
|
e3ffab |
|
|
|
e3ffab |
/* Decode the optional token DN. */
|
|
|
e3ffab |
- ber_scanf(ber, "a", &token_dn);
|
|
|
e3ffab |
+ (void)ber_scanf(ber, "a", &token_dn);
|
|
|
e3ffab |
|
|
|
e3ffab |
/* Process the synchronization. */
|
|
|
e3ffab |
success = false;
|
|
|
e3ffab |
--
|
|
|
e3ffab |
2.1.0
|
|
|
e3ffab |
|