tevent: allow tevent_abort() to cope with ev == NULL
authorStefan Metzmacher <metze@samba.org>
Thu, 22 Mar 2018 15:51:01 +0000 (16:51 +0100)
committerStefan Metzmacher <metze@samba.org>
Thu, 17 May 2018 07:51:45 +0000 (09:51 +0200)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
lib/tevent/tevent.c

index a2d2003cbf4322dd1524e7e7e40edcbd37e10d5b..3d32fd7e12de91f2c0354e3ad053d47f3ebae671 100644 (file)
@@ -577,8 +577,10 @@ void tevent_set_abort_fn(void (*abort_fn)(const char *reason))
 
 static void tevent_abort(struct tevent_context *ev, const char *reason)
 {
-       tevent_debug(ev, TEVENT_DEBUG_FATAL,
-                    "abort: %s\n", reason);
+       if (ev != NULL) {
+               tevent_debug(ev, TEVENT_DEBUG_FATAL,
+                            "abort: %s\n", reason);
+       }
 
        if (!tevent_abort_fn) {
                abort();