lib: Fix an error path memleak
authorVolker Lendecke <vl@samba.org>
Wed, 26 Jul 2017 15:24:51 +0000 (17:24 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Mon, 31 Jul 2017 11:49:01 +0000 (13:49 +0200)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Mon Jul 31 13:49:02 CEST 2017 on sn-devel-144

libcli/auth/schannel_state_tdb.c

index f55ae0ffb560d17c8b41b5c0a3c3e64f3ed65388..6a19823f6393cfea7873da08656abd12b0d52a9e 100644 (file)
@@ -263,11 +263,13 @@ NTSTATUS schannel_save_creds_state(TALLOC_CTX *mem_ctx,
 
        db_sc = open_schannel_session_store(tmpctx, lp_ctx);
        if (!db_sc) {
-               return NT_STATUS_ACCESS_DENIED;
+               status = NT_STATUS_ACCESS_DENIED;
+               goto fail;
        }
 
        status = schannel_store_session_key_tdb(db_sc, tmpctx, creds);
 
+fail:
        talloc_free(tmpctx);
        return status;
 }