s4/libcli/raw: clang: Fix 'initialization value is never read'
authorNoel Power <noel.power@suse.com>
Thu, 11 Jul 2019 11:33:18 +0000 (11:33 +0000)
committerGary Lockyer <gary@samba.org>
Tue, 16 Jul 2019 22:52:24 +0000 (22:52 +0000)
Fixes:

source4/libcli/raw/rawnegotiate.c:157:11: warning: Value stored to 'status' during its initialization is never read <--[clang]
        NTSTATUS status = NT_STATUS_INTERNAL_ERROR;
                 ^~~~~~   ~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
source4/libcli/raw/rawnegotiate.c

index cec081c364a41454489f98dd1df148ec0fc073dc..51c6f0f9ecbed294c9ee4afc106378dd49628944 100644 (file)
@@ -154,7 +154,7 @@ NTSTATUS smb_raw_negotiate_recv(struct tevent_req *req)
 NTSTATUS smb_raw_negotiate(struct smbcli_transport *transport, bool unicode,
                           int minprotocol, int maxprotocol)
 {
-       NTSTATUS status = NT_STATUS_INTERNAL_ERROR;
+       NTSTATUS status;
        struct tevent_req *subreq = NULL;
        bool ok;
 
@@ -164,7 +164,8 @@ NTSTATUS smb_raw_negotiate(struct smbcli_transport *transport, bool unicode,
                                        minprotocol,
                                        maxprotocol);
        if (subreq == NULL) {
-               return NT_STATUS_NO_MEMORY;
+               status = NT_STATUS_NO_MEMORY;
+               goto failed;
        }
 
        ok = tevent_req_poll(subreq, transport->ev);