r2466: Fix memleak found by sean.chandler@verizon.net.
authorVolker Lendecke <vlendec@samba.org>
Tue, 21 Sep 2004 07:55:49 +0000 (07:55 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 15:52:44 +0000 (10:52 -0500)
Thanks!

Volker
(This used to be commit 587d863ae87042e0193b8d27b52ab3f75c58974b)

source3/libsmb/cliconnect.c

index 98656c119d35649dd4250e95d4ff4458eb2e1080..4ff60c1b1cacc8c4158640cf732ba717d8b18aa5 100644 (file)
@@ -668,11 +668,16 @@ static NTSTATUS cli_session_setup_ntlmssp(struct cli_state *cli, const char *use
                DATA_BLOB key = data_blob(ntlmssp_state->session_key.data,
                                          ntlmssp_state->session_key.length);
                DATA_BLOB null_blob = data_blob(NULL, 0);
+               BOOL res;
 
                fstrcpy(cli->server_domain, ntlmssp_state->server_domain);
                cli_set_session_key(cli, ntlmssp_state->session_key);
 
-               if (cli_simple_set_signing(cli, key, null_blob)) {
+               res = cli_simple_set_signing(cli, key, null_blob);
+
+               data_blob_free(&key);
+
+               if (res) {
                        
                        /* 'resign' the last message, so we get the right sequence numbers
                           for checking the first reply from the server */