[PATCH] Free kerberos context on error

swen swen at linux.ibm.com
Wed Nov 21 09:26:57 UTC 2018


Small fix for smbspool.

Please review and push if happy.

Cheers Swen
-------------- next part --------------
From 6a983bfa21ee114209988b8c994028b468fc21c6 Mon Sep 17 00:00:00 2001
From: Swen Schillig <swen at linux.ibm.com>
Date: Wed, 21 Nov 2018 10:21:46 +0100
Subject: [PATCH] Free kerberos context on error

If processing cannot continue and the function returns
the kerberos context must be free'd.

Signed-off-by: Swen Schillig <swen at linux.ibm.com>
---
 source3/client/smbspool.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/source3/client/smbspool.c b/source3/client/smbspool.c
index 6e257e9aede..5450b9ee059 100644
--- a/source3/client/smbspool.c
+++ b/source3/client/smbspool.c
@@ -526,6 +526,7 @@ static bool kerberos_ccache_is_valid(void) {
 
 	ccache_name = krb5_cc_default_name(ctx);
 	if (ccache_name == NULL) {
+		krb5_free_context(ctx);
 		return false;
 	}
 
-- 
2.17.2



More information about the samba-technical mailing list