From 5207d456f1132041a07c9b3c48bfa7a9112a698f Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Tue, 19 Feb 2013 09:00:51 +0100 Subject: s4-libcli: Check return value of smbcli_request_setup(). Reviewed-by: Alexander Bokovoy --- source4/libcli/climessage.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'source4/libcli/climessage.c') diff --git a/source4/libcli/climessage.c b/source4/libcli/climessage.c index 5ed0e8e3cd..3e9808c128 100644 --- a/source4/libcli/climessage.c +++ b/source4/libcli/climessage.c @@ -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) || -- cgit