Remove an unneeded conditional in the cleanup for kadmin's keytab
authorGreg Hudson <ghudson@mit.edu>
Fri, 21 May 2010 19:15:20 +0000 (19:15 +0000)
committerGreg Hudson <ghudson@mit.edu>
Fri, 21 May 2010 19:15:20 +0000 (19:15 +0000)
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

index 8d14f860a620414c870d9894d12f3761acfc6027..a2f8775fb48445efebf3f9aab368533187863d9a 100644 (file)
@@ -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);
 }