From ac631853a8f63252492f6443867c505083b327b5 Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Tue, 12 Apr 2022 13:30:32 -0400 Subject: [PATCH] client: Free command parser after event loop commit ed7b1690f0054888795059c2ef6ddd2f8107786a added an explicit command parser free call on exit to make memory analysis tools give better results. That commit freed the command parser a little too early, though, before the event loop gets freed and the event loop exit handlers are run. The command parser uses an exit handler to clear a weak reference on the event loop, so freeing the command parser before the event loop can lead to crash. This commit moves the free call a little lower. Related: https://gitlab.freedesktop.org/plymouth/plymouth/-/issues/175 --- src/client/plymouth.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client/plymouth.c b/src/client/plymouth.c index c2313368..4c95e688 100644 --- a/src/client/plymouth.c +++ b/src/client/plymouth.c @@ -1219,12 +1219,12 @@ main (int argc, exit_code = ply_event_loop_run (state.loop); out: - ply_command_parser_free (state.command_parser); - ply_boot_client_free (state.client); ply_event_loop_free (state.loop); + ply_command_parser_free (state.command_parser); + return exit_code; } /* vim: set ts=4 sw=4 expandtab autoindent cindent cino={.5s,(0: */ -- 2.47.3