From 2bdf17370c0f0353918e5c8dfaf2913fceb9d4dc Mon Sep 17 00:00:00 2001 From: icy17 <1061499390@qq.com> Date: Wed, 10 Apr 2024 16:18:27 +0800 Subject: [PATCH] Fix potential Null pointer dereference in regress_finalize.c --- test/regress_finalize.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/regress_finalize.c b/test/regress_finalize.c index 9e571881..543cd948 100644 --- a/test/regress_finalize.c +++ b/test/regress_finalize.c @@ -130,6 +130,7 @@ test_fin_cb_invoked(void *arg) /* Okay, now add but don't have it become active, and make sure *that* * works. */ ev = evtimer_new(base, timer_callback, &ev_called); + tt_assert(ev); event_add(ev, &ten_sec); event_free_finalize(0, ev, event_finalize_callback_1); @@ -141,6 +142,7 @@ test_fin_cb_invoked(void *arg) /* Now try adding and deleting after finalizing. */ ev = evtimer_new(base, timer_callback, &ev_called); + tt_assert(ev); evtimer_assign(&ev2, base, timer_callback, &ev_called); event_add(ev, &ten_sec); event_free_finalize(0, ev, event_finalize_callback_1);