From 7647d50a3e8c56eb423c4be8c5c5f9fadd827171 Mon Sep 17 00:00:00 2001 From: icy17 <39425646+icy17@users.noreply.github.com> Date: Tue, 23 Apr 2024 11:52:15 +0800 Subject: [PATCH] Fix potential Null pointer dereference in timer.c (#2759) --- daemon/timer.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/daemon/timer.c b/daemon/timer.c index d4234406..317f23ec 100644 --- a/daemon/timer.c +++ b/daemon/timer.c @@ -85,6 +85,9 @@ seaf_timer_new (TimerCB func, timer->user_data = user_data; timer->event = evtimer_new (seaf->ev_base, timer_callback, timer); + if (timer->event == NULL) { + return NULL; + } evtimer_add (timer->event, &timer->tv); return timer;