summaryrefslogtreecommitdiffstats
path: root/daemons
diff options
context:
space:
mode:
authorJan Cholasta <jcholast@redhat.com>2014-11-05 08:53:41 +0000
committerMartin Kosek <mkosek@redhat.com>2014-11-05 15:28:27 +0100
commit4e49f39e1a9c267c52b409a083a202c27171ae4d (patch)
treedae6c548f98a791517a2ba53bc12810bf58d7825 /daemons
parent9062dcada48d378f7c46759607aff03c17b11163 (diff)
downloadfreeipa-4e49f39e1a9c267c52b409a083a202c27171ae4d.tar.gz
freeipa-4e49f39e1a9c267c52b409a083a202c27171ae4d.tar.xz
freeipa-4e49f39e1a9c267c52b409a083a202c27171ae4d.zip
Fix memory leak in ipa-pwd-extop
Also remove dead code and explicitly mark an ignored return value to prevent false positives in static code analysis. https://fedorahosted.org/freeipa/ticket/4651 Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
Diffstat (limited to 'daemons')
-rw-r--r--daemons/ipa-slapi-plugins/ipa-pwd-extop/ipa_pwd_extop.c3
-rw-r--r--daemons/ipa-slapi-plugins/ipa-pwd-extop/syncreq.c2
2 files changed, 2 insertions, 3 deletions
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
index ca021cac7..f0346a343 100644
--- a/daemons/ipa-slapi-plugins/ipa-pwd-extop/ipa_pwd_extop.c
+++ b/daemons/ipa-slapi-plugins/ipa-pwd-extop/ipa_pwd_extop.c
@@ -1393,6 +1393,7 @@ done:
if (rc != LDAP_SUCCESS) {
free(password);
free(svcname);
+ free(enctypes);
*_err_msg = err_msg;
} else {
*_password = password;
@@ -1639,7 +1640,6 @@ static int ipapwd_getkeytab(Slapi_PBlock *pb, struct ipapwd_krbcfg *krbcfg)
krb5_context krbctx = NULL;
krb5_error_code krberr;
struct berval *extop_value = NULL;
- BerElement *ber = NULL;
char *service_name = NULL;
char *svcname;
Slapi_Entry *target_entry = NULL;
@@ -1827,7 +1827,6 @@ free_and_return:
}
free(svals);
}
- if (ber) ber_free(ber, 1);
if (bvp) ber_bvfree(bvp);
return SLAPI_PLUGIN_EXTENDED_SENT_RESULT;
diff --git a/daemons/ipa-slapi-plugins/ipa-pwd-extop/syncreq.c b/daemons/ipa-slapi-plugins/ipa-pwd-extop/syncreq.c
index 2bfcf10a2..cbb4536e7 100644
--- a/daemons/ipa-slapi-plugins/ipa-pwd-extop/syncreq.c
+++ b/daemons/ipa-slapi-plugins/ipa-pwd-extop/syncreq.c
@@ -86,7 +86,7 @@ bool sync_request_handle(Slapi_ComponentId *plugin_id, Slapi_PBlock *pb,
}
/* Decode the optional token DN. */
- ber_scanf(ber, "a", &token_dn);
+ (void)ber_scanf(ber, "a", &token_dn);
/* Process the synchronization. */
success = false;