diff --git a/crypto/heimdal/lib/hdb/keys.c b/crypto/heimdal/lib/hdb/keys.c index 9c0af5c47f2..ef611361000 100644 --- a/crypto/heimdal/lib/hdb/keys.c +++ b/crypto/heimdal/lib/hdb/keys.c @@ -238,7 +238,7 @@ hdb_add_current_keys_to_history(krb5_context context, hdb_entry *entry) hist_keys = &ext->data.u.hist_keys; hist_keys->val = calloc(1, sizeof (*hist_keys->val)); if (hist_keys->val == NULL) { - free(hist_keys); + free(ext); return ENOMEM; } hist_keys->len = 1;