From 3e8172f9e35459c6c4ef028db004b4fce1fe0631 Mon Sep 17 00:00:00 2001 From: "Asanka C. Herath" Date: Thu, 2 Dec 2010 01:16:05 -0500 Subject: [PATCH] Initialize allocated memory in any_resolve() Otherwise we might attempt to free an uninitialized pointer. --- lib/krb5/keytab_any.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/krb5/keytab_any.c b/lib/krb5/keytab_any.c index d05696476..d5ac4883d 100644 --- a/lib/krb5/keytab_any.c +++ b/lib/krb5/keytab_any.c @@ -61,7 +61,7 @@ any_resolve(krb5_context context, const char *name, krb5_keytab id) char buf[256]; while (strsep_copy(&name, ",", buf, sizeof(buf)) != -1) { - a = malloc(sizeof(*a)); + a = calloc(1, sizeof(*a)); if (a == NULL) { ret = ENOMEM; goto fail;