Fix potential Null pointer dereference in timer.c (#2759)

This commit is contained in:
icy17 2024-04-23 11:52:15 +08:00 committed by GitHub
parent 5cd98b7b9e
commit 7647d50a3e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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;