From 97a40d8838186dcbf02965e77a891696a4d06e39 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Fri, 18 Nov 2016 20:58:39 -0500 Subject: [PATCH] hdb: hdb_add_aliases frees uninitialized memory This bug was never shipped in a release. It was introduced by commit 1c81ddf4e26b3637d1d37c08c045274fdc0a50cc. Change-Id: Ia9f6d69b2858a75cc51e50034fe70e29f13b8fc1 --- lib/hdb/common.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/hdb/common.c b/lib/hdb/common.c index b8ecd3278..2c8bb9f30 100644 --- a/lib/hdb/common.c +++ b/lib/hdb/common.c @@ -254,10 +254,9 @@ hdb_add_aliases(krb5_context context, HDB *db, entryalias.principal = entry->entry.principal; code = hdb_entry_alias2value(context, &entryalias, &value); - if (code) { - krb5_data_free(&key); + if (code) return code; - } + code = hdb_principal2key(context, &aliases->aliases.val[i], &key); if (code == 0) { code = db->hdb__put(context, db, flags, key, value);