Highly likely that's a false positive because Coverity does not
understand that srv_encrypt_buffer() only allocates when
NT_STATUS_OK(status), but it does not hurt to make it happy this way.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
}
if (do_encrypt) {
- NTSTATUS status = srv_encrypt_buffer(xconn, buffer, &buf_out);
+ char *enc = NULL;
+ NTSTATUS status = srv_encrypt_buffer(xconn, buffer, &enc);
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;