1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00

net: Fix CID 1128559 Dereference null return value

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Volker Lendecke 2018-03-28 07:24:01 -05:00 committed by Jeremy Allison
parent cfe8fa2c75
commit 67c31842b0

View File

@ -915,6 +915,7 @@ static struct functable net_func[] = {
const char **argv_const = discard_const_p(const char *, argv);
poptContext pc;
TALLOC_CTX *frame = talloc_stackframe();
struct tevent_context *ev;
struct net_context *c = talloc_zero(frame, struct net_context);
NTSTATUS status;
@ -1036,9 +1037,12 @@ static struct functable net_func[] = {
exit(1);
}
status = messaging_init_client(c,
samba_tevent_context_init(c),
&c->msg_ctx);
ev = samba_tevent_context_init(c);
if (ev == NULL) {
d_fprintf(stderr, "samba_tevent_context_init failed\n");
exit(1);
}
status = messaging_init_client(c, ev, &c->msg_ctx);
if (geteuid() != 0 &&
NT_STATUS_EQUAL(status, NT_STATUS_ACCESS_DENIED)) {
/*