1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-08 21:18:16 +03:00

s4-libcli: Check return value of smbcli_request_setup().

Reviewed-by: Alexander Bokovoy <ab@samba.org>
This commit is contained in:
Andreas Schneider 2013-02-19 09:00:51 +01:00 committed by Alexander Bokovoy
parent 9e6e9c7707
commit 5207d456f1
3 changed files with 15 additions and 0 deletions

View File

@ -33,6 +33,9 @@ bool smbcli_message_start(struct smbcli_tree *tree, const char *host, const char
struct smbcli_request *req;
req = smbcli_request_setup(tree, SMBsendstrt, 0, 0);
if (req == NULL) {
return false;
}
smbcli_req_append_string(req, username, STR_TERMINATE);
smbcli_req_append_string(req, host, STR_TERMINATE);
if (!smbcli_request_send(req) ||
@ -57,6 +60,9 @@ bool smbcli_message_text(struct smbcli_tree *tree, char *msg, int len, int grp)
struct smbcli_request *req;
req = smbcli_request_setup(tree, SMBsendtxt, 1, 0);
if (req == NULL) {
return false;
}
SSVAL(req->out.vwv, VWV(0), grp);
smbcli_req_append_bytes(req, (const uint8_t *)msg, len);
@ -80,6 +86,9 @@ bool smbcli_message_end(struct smbcli_tree *tree, int grp)
struct smbcli_request *req;
req = smbcli_request_setup(tree, SMBsendend, 1, 0);
if (req == NULL) {
return false;
}
SSVAL(req->out.vwv, VWV(0), grp);
if (!smbcli_request_send(req) ||

View File

@ -30,6 +30,9 @@ _PUBLIC_ bool smbcli_oplock_ack(struct smbcli_tree *tree, uint16_t fnum, uint16_
struct smbcli_request *req;
req = smbcli_request_setup(tree, SMBlockingX, 8, 0);
if (req == NULL) {
return false;
}
SSVAL(req->out.vwv,VWV(0),0xFF);
SSVAL(req->out.vwv,VWV(1),0);

View File

@ -168,6 +168,9 @@ _PUBLIC_ NTSTATUS smb_tree_disconnect(struct smbcli_tree *tree)
if (!tree) return NT_STATUS_OK;
req = smbcli_request_setup(tree, SMBtdis, 0, 0);
if (req == NULL) {
return NT_STATUS_NO_MEMORY;
}
if (smbcli_request_send(req)) {
(void) smbcli_request_receive(req);