core/timer: fix potential use-after-free

This commit is contained in:
Yu Watanabe
2022-05-10 14:10:17 +09:00
committed by Zbigniew Jędrzejewski-Szmek
parent d3ab7b8078
commit 756491af39

View File

@@ -68,7 +68,7 @@ static void timer_done(Unit *u) {
t->monotonic_event_source = sd_event_source_disable_unref(t->monotonic_event_source);
t->realtime_event_source = sd_event_source_disable_unref(t->realtime_event_source);
free(t->stamp_path);
t->stamp_path = mfree(t->stamp_path);
}
static int timer_verify(Timer *t) {