We cannot free ‘enc’ — it may be a copy of ‘buffer’, in which parameter
both construct_reply_chain() and smb_request_done() pass arrays of
automatic storage duration!
Fixes CID
1505354.
This reverts commit
a395f752f0748751d4ade533c41066903f26c2dd.
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
}
if (do_encrypt) {
- char *enc = NULL;
- NTSTATUS status = srv_encrypt_buffer(xconn, buffer, &enc);
+ NTSTATUS status = srv_encrypt_buffer(xconn, buffer, &buf_out);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0, ("send_smb: SMB encryption failed "
"on outgoing packet! Error %s\n",
nt_errstr(status) ));
- SAFE_FREE(enc);
ret = -1;
goto out;
}
- buf_out = enc;
}
len = smb_len_large(buf_out) + 4;