smbspool: Free kerberos context on error
authorSwen Schillig <swen@linux.ibm.com>
Wed, 21 Nov 2018 09:21:46 +0000 (10:21 +0100)
committerRalph Boehme <slow@samba.org>
Thu, 22 Nov 2018 07:22:18 +0000 (08:22 +0100)
If processing cannot continue and the function returns
the kerberos context must be free'd.

Signed-off-by: Swen Schillig <swen@linux.ibm.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/client/smbspool.c

index 389e4ea553fbd411272ffad8d20bf133b0d497ab..58ce6c56177adcd0c0da8ec4696c44418feddf2e 100644 (file)
@@ -523,6 +523,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;
        }