admin: Fix double-free in keytab JSON listing
authorNicolas Williams <nico@twosigma.com>
Fri, 30 Dec 2022 22:39:42 +0000 (16:39 -0600)
committerNicolas Williams <nico@twosigma.com>
Wed, 4 Jan 2023 07:36:03 +0000 (01:36 -0600)
admin/get.c
admin/list.c

index 7ecf2a8f9b34161bd413c9e5663708e5005ade74..1c0a6333a5abe29be8218214319ace1acbe99d40 100644 (file)
@@ -166,7 +166,7 @@ kt_get(struct get_options *opt, int argc, char **argv)
        kadm5_principal_ent_rec princ;
        int mask = 0;
        krb5_keyblock *keys;
-       int n_keys;
+       int n_keys = 0;
        int created = 0;
        krb5_keytab_entry entry;
 
index 9d1e9d5d483712b7bb520d694a64d00ab2c82580..22ccdcac8cb20dd1ebff79af9f24b4ddaea0a8e2 100644 (file)
@@ -233,7 +233,6 @@ do_list1_json(struct list_options *opt,
            }
             heim_dict_set_value(d, HSTR("aliases"), aliases);
             heim_release(aliases);
-            free(s);
        }
 
        krb5_kt_free_entry(context, &entry);