From 735618a1c6aee05d1c6455320da46fc52c85ca8c Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Tue, 20 Mar 2012 09:47:52 -0400 Subject: 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 --- ipa-client/ipa-getkeytab.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ipa-client/ipa-getkeytab.c') diff --git a/ipa-client/ipa-getkeytab.c b/ipa-client/ipa-getkeytab.c index aa9336f2e..05e57bbe1 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; -- cgit