diff options
author | Simo Sorce <ssorce@redhat.com> | 2012-03-20 09:47:52 -0400 |
---|---|---|
committer | Martin Kosek <mkosek@redhat.com> | 2012-03-22 17:33:13 +0100 |
commit | 735618a1c6aee05d1c6455320da46fc52c85ca8c (patch) | |
tree | 8e28717668d2892a5ba4474a5d2c86fd5da7a96c /ipa-client | |
parent | 19b2af8e52d772aaba190beb747fc2e87821fdbe (diff) | |
download | freeipa.git-735618a1c6aee05d1c6455320da46fc52c85ca8c.tar.gz freeipa.git-735618a1c6aee05d1c6455320da46fc52c85ca8c.tar.xz freeipa.git-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 'ipa-client')
-rw-r--r-- | ipa-client/ipa-getkeytab.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ipa-client/ipa-getkeytab.c b/ipa-client/ipa-getkeytab.c index aa9336f2..05e57bbe 100644 --- a/ipa-client/ipa-getkeytab.c +++ b/ipa-client/ipa-getkeytab.c @@ -211,10 +211,10 @@ static int prep_ksdata(krb5_context krbctx, const char *str, if (krberr != 0) { fprintf(stderr, _("Warning unrecognized encryption type: [%s]\n"), t); - t = p+1; + if (p) t = p + 1; continue; } - t = p+1; + if (p) t = p + 1; if (!q) { ksdata[j].salttype = KRB5_KDB_SALTTYPE_NORMAL; |