From: Volker Lendecke Date: Wed, 28 Mar 2018 12:22:02 +0000 (-0500) Subject: smbstatus: Fix CID 1128560 Dereference null return value X-Git-Tag: talloc-2.1.13~118 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=cfe8fa2c75426680d5253b52dc84e34d391f23e0;p=thirdparty%2Fsamba.git smbstatus: Fix CID 1128560 Dereference null return value Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- diff --git a/source3/utils/status.c b/source3/utils/status.c index beae85c4d3e..6370f7002e8 100644 --- a/source3/utils/status.c +++ b/source3/utils/status.c @@ -528,6 +528,7 @@ int main(int argc, const char *argv[]) }; TALLOC_CTX *frame = talloc_stackframe(); int ret = 0; + struct tevent_context *ev; struct messaging_context *msg_ctx = NULL; char *db_path; bool ok; @@ -618,7 +619,14 @@ int main(int argc, const char *argv[]) * This implicitly initializes the global ctdbd connection, * usable by the db_open() calls further down. */ - msg_ctx = messaging_init(NULL, samba_tevent_context_init(NULL)); + ev = samba_tevent_context_init(NULL); + if (ev == NULL) { + fprintf(stderr, "samba_tevent_context_init failed\n"); + ret = -1; + goto done; + } + + msg_ctx = messaging_init(NULL, ev); if (msg_ctx == NULL) { fprintf(stderr, "messaging_init failed\n"); ret = -1;