From a6a91e5dbc96498ef33505e4bf96466590f0da42 Mon Sep 17 00:00:00 2001 From: Martin Kosek Date: Thu, 13 Jan 2011 11:46:11 +0100 Subject: Unitialized pointer read in ipa-join This patch fixes a possible situation when krb5_kt_close() function is called with uninitialized keytab parameter. https://fedorahosted.org/freeipa/ticket/712 --- ipa-client/ipa-join.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ipa-client') diff --git a/ipa-client/ipa-join.c b/ipa-client/ipa-join.c index fa2e11d7c..d23348954 100644 --- a/ipa-client/ipa-join.c +++ b/ipa-client/ipa-join.c @@ -664,7 +664,7 @@ unenroll_host(const char *server, const char *hostname, const char *ktname, int char *realm = NULL; krb5_context krbctx = NULL; - krb5_keytab keytab; + krb5_keytab keytab = NULL; krb5_ccache ccache = NULL; krb5_principal princ = NULL; krb5_error_code krberr; @@ -849,7 +849,7 @@ unenroll_host(const char *server, const char *hostname, const char *ktname, int cleanup: - krb5_kt_close(krbctx, keytab); + if (keytab) krb5_kt_close(krbctx, keytab); free((char *)principal); free((char *)ipaserver); if (princ) krb5_free_principal(krbctx, princ); -- cgit