From: Yu Watanabe Date: Tue, 10 May 2022 05:10:17 +0000 (+0900) Subject: core/timer: fix potential use-after-free X-Git-Tag: v251-rc3~25 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=756491af392a99c4286d876b0041535e50df80ad;p=thirdparty%2Fsystemd.git core/timer: fix potential use-after-free --- diff --git a/src/core/timer.c b/src/core/timer.c index 17663a175b8..63256d541ac 100644 --- a/src/core/timer.c +++ b/src/core/timer.c @@ -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) {