From a21915bebf12cddc2fd4819bcc6efedfebdc85a9 Mon Sep 17 00:00:00 2001 From: Greg Hudson Date: Fri, 21 May 2010 19:15:20 +0000 Subject: [PATCH] Remove an unneeded conditional in the cleanup for kadmin's keytab add_principal(), squashing a false-positive memory leak from Coverity. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@24083 dc483132-0cff-0310-8789-dd5450dbe970 --- src/kadmin/cli/keytab.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/kadmin/cli/keytab.c b/src/kadmin/cli/keytab.c index 8d14f860a..a2f8775fb 100644 --- a/src/kadmin/cli/keytab.c +++ b/src/kadmin/cli/keytab.c @@ -334,11 +334,9 @@ add_principal(void *lhandle, char *keytab_str, krb5_keytab keytab, } cleanup: - if (nkeys) { - for (i = 0; i < nkeys; i++) - krb5_free_keyblock_contents(context, &keys[i]); - free(keys); - } + for (i = 0; i < nkeys; i++) + krb5_free_keyblock_contents(context, &keys[i]); + free(keys); krb5_free_principal(context, princ); } -- 2.26.2