From 5c6eaadd24ed432347e55f6827e8d8ac670cd534 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
Referenxe:https://github.com/libevent/libevent/pull/1598/

---
 test/regress_finalize.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/test/regress_finalize.c b/test/regress_finalize.c
index 9e57188..543cd94 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);
-- 
2.27.0

