]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core/timer: fix potential use-after-free
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 10 May 2022 05:10:17 +0000 (14:10 +0900)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 10 May 2022 11:50:50 +0000 (13:50 +0200)
src/core/timer.c

index 17663a175b8b3488d9f088abd2afdc00f6f3a78a..63256d541acfe0ef7b8bce69e3012e9d472fd8ac 100644 (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) {