2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-31 14:25:15 +00:00

When freeing an event base, reset ev->base to NULL for associated events.

This commit is contained in:
Todd C. Miller
2019-11-15 13:35:19 -07:00
parent 3689839a0e
commit f6acc134f4

View File

@@ -236,10 +236,12 @@ sudo_ev_base_free_v1(struct sudo_event_base *base)
/* Remove any existing events before freeing the base. */
TAILQ_FOREACH_SAFE(ev, &base->events, entries, next) {
sudo_ev_del(base, ev);
ev->base = NULL;
}
for (i = 0; i < NSIG; i++) {
TAILQ_FOREACH_SAFE(ev, &base->signals[i], entries, next) {
sudo_ev_del(base, ev);
ev->base = NULL;
}
free(base->siginfo[i]);
free(base->orig_handlers[i]);