From 03302bcb8649aade7d9ed7e011710e4430f542ae Mon Sep 17 00:00:00 2001 From: Noel Power Date: Mon, 18 Apr 2016 13:02:59 +0100 Subject: [PATCH] s4:libcli: fix 'Conditional jump or move' valgrind error smbtorture test base.tcondev.tcondev causes the following valgrind trace ==23282== Conditional jump or move depends on uninitialised value(s) ==23282== at 0x9BE5632: smbcli_tconX (cliconnect.c:148) ==23282== by 0x41021C: tcon_devtest (base.c:91) ==23282== by 0x411A01: run_tcon_devtype_test (base.c:522) ==23282== by 0x16B21D: wrap_simple_1smb_test (util_smb.c:856) ==23282== by 0x955368F: internal_torture_run_test (torture.c:442) ==23282== by 0x9553A6B: torture_run_test_restricted (torture.c:542) ==23282== by 0x2600A4: run_matching (smbtorture.c:110) ==23282== by 0x25FF66: run_matching (smbtorture.c:95) ==23282== by 0x2601C5: torture_run_named_tests (smbtorture.c:143) ==23282== by 0x261E44: main (smbtorture.c:665) ==23282== Signed-off-by: Noel Power Reviewed-by: Volker Lendecke Reviewed-by: Andreas Schneider --- source4/libcli/cliconnect.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source4/libcli/cliconnect.c b/source4/libcli/cliconnect.c index 35d963eebf8..58118b086aa 100644 --- a/source4/libcli/cliconnect.c +++ b/source4/libcli/cliconnect.c @@ -142,13 +142,16 @@ NTSTATUS smbcli_tconX(struct smbcli_state *cli, const char *sharename, tcon.tconx.in.device = devtype; status = smb_raw_tcon(cli->tree, mem_ctx, &tcon); - + if (!NT_STATUS_IS_OK(status)) { + goto out; + } cli->tree->tid = tcon.tconx.out.tid; if (tcon.tconx.out.options & SMB_EXTENDED_SIGNATURES) { smb1cli_session_protect_session_key(cli->tree->session->smbXcli); } +out: talloc_free(mem_ctx); return status;