From c979a356f71a9692b5b39332973c1b33d96f8f6d Mon Sep 17 00:00:00 2001 From: Love Hornquist Astrand Date: Tue, 27 Nov 2012 21:28:46 -0800 Subject: [PATCH] uninited memory free --- lib/krb5/principal.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/krb5/principal.c b/lib/krb5/principal.c index 90e4b7689..b7c367d5c 100644 --- a/lib/krb5/principal.c +++ b/lib/krb5/principal.c @@ -1035,7 +1035,7 @@ krb5_sname_to_principal_old(krb5_context context, { krb5_error_code ret; char localhost[MAXHOSTNAMELEN]; - char **realms, *host = NULL; + char **realms = NULL, *host = NULL; if(type != KRB5_NT_SRV_HST && type != KRB5_NT_UNKNOWN) { krb5_set_error_message(context, KRB5_SNAME_UNSUPP_NAMETYPE, @@ -1079,7 +1079,8 @@ krb5_sname_to_principal_old(krb5_context context, hostname, NULL); if(host) free(host); - krb5_free_host_realm(context, realms); + if (realms) + krb5_free_host_realm(context, realms); return ret; }