s3-libsmb: Duplicate the memory before we free it.
authorAndreas Schneider <asn@samba.org>
Fri, 14 Nov 2014 09:05:13 +0000 (10:05 +0100)
committerAndreas Schneider <asn@cryptomilk.org>
Tue, 2 Dec 2014 20:46:53 +0000 (21:46 +0100)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=10279

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Tue Dec  2 21:46:53 CET 2014 on sn-devel-104

source3/libsmb/ntlmssp.c

index 0a62b8b11b4c31057675f1b7bb4a58ea59e59121..617b34b497722dc570d28c875686c3091cfe74d1 100644 (file)
@@ -422,9 +422,12 @@ static NTSTATUS ntlmssp3_client_challenge(struct ntlmssp_state *ntlmssp_state,
                        goto noccache;
                }
 
-               *next_request = data_blob(wbc_next->data, wbc_next->length);
-               ntlmssp_state->session_key = data_blob(
-                       wbc_session_key->data, wbc_session_key->length);
+               *next_request = data_blob_talloc(ntlmssp_state,
+                                                wbc_next->data,
+                                                wbc_next->length);
+               ntlmssp_state->session_key = data_blob_talloc(ntlmssp_state,
+                                                             wbc_session_key->data,
+                                                             wbc_session_key->length);
 
                wbcFreeMemory(info);
                goto done;