summaryrefslogtreecommitdiffstats
path: root/daemons/ipa-kdb/ipa_kdb_pwdpolicy.c
diff options
context:
space:
mode:
authorSimo Sorce <ssorce@redhat.com>2012-03-20 09:47:52 -0400
committerMartin Kosek <mkosek@redhat.com>2012-03-22 17:33:13 +0100
commit735618a1c6aee05d1c6455320da46fc52c85ca8c (patch)
tree8e28717668d2892a5ba4474a5d2c86fd5da7a96c /daemons/ipa-kdb/ipa_kdb_pwdpolicy.c
parent19b2af8e52d772aaba190beb747fc2e87821fdbe (diff)
downloadfreeipa-735618a1c6aee05d1c6455320da46fc52c85ca8c.tar.gz
freeipa-735618a1c6aee05d1c6455320da46fc52c85ca8c.tar.xz
freeipa-735618a1c6aee05d1c6455320da46fc52c85ca8c.zip
Fix memleak and silence Coverity defects
Some of these are not real defects, because we are guaranteed to have valid context in some functions, and checks are not necessary. I added the checks anyway in order to silence Coverity on these issues. One meleak on error condition was fixed in daemons/ipa-kdb/ipa_kdb_pwdpolicy.c Silence errors in ipa-client/ipa-getkeytab.c, the code looks wrong, but it is actually fine as we count before hand so we never actually use the wrong value that is computed on the last pass when p == 0 Fixes: https://fedorahosted.org/freeipa/ticket/2488
Diffstat (limited to 'daemons/ipa-kdb/ipa_kdb_pwdpolicy.c')
-rw-r--r--daemons/ipa-kdb/ipa_kdb_pwdpolicy.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/daemons/ipa-kdb/ipa_kdb_pwdpolicy.c b/daemons/ipa-kdb/ipa_kdb_pwdpolicy.c
index 91de0342b..a54380815 100644
--- a/daemons/ipa-kdb/ipa_kdb_pwdpolicy.c
+++ b/daemons/ipa-kdb/ipa_kdb_pwdpolicy.c
@@ -121,6 +121,9 @@ krb5_error_code ipadb_get_ipapwd_policy(struct ipadb_context *ipactx,
done:
ldap_msgfree(res);
+ if (kerr) {
+ free(pol);
+ }
return kerr;
}