From: Noel Power Date: Fri, 24 May 2019 11:03:09 +0000 (+0000) Subject: s4/torture/rpc: cppcheck: Fix ctunullpointer error X-Git-Tag: ldb-2.0.5~415 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1c6db152bf1b0de205017dcfae358ba362545de1;p=thirdparty%2Fsamba.git s4/torture/rpc: cppcheck: Fix ctunullpointer error Fixes source4/torture/rpc/netlogon.c:307: error: ctunullpointer: Null pointer dereference: p <--[cppcheck] Signed-off-by: Noel Power Reviewed-by: Gary Lockyer gary@catalyst.net.nz --- diff --git a/source4/torture/rpc/netlogon.c b/source4/torture/rpc/netlogon.c index 52c443e39f3..94fe4020fa9 100644 --- a/source4/torture/rpc/netlogon.c +++ b/source4/torture/rpc/netlogon.c @@ -304,7 +304,13 @@ bool test_SetupCredentials3(struct dcerpc_pipe *p, struct torture_context *tctx, uint32_t rid; const char *machine_name; const char *plain_pass; - struct dcerpc_binding_handle *b = p->binding_handle; + struct dcerpc_binding_handle *b = NULL; + + if (p == NULL) { + return false; + } + + b = p->binding_handle; machine_name = cli_credentials_get_workstation(machine_credentials); torture_assert(tctx, machine_name != NULL, "machine_name");