From: Ray Strode Date: Tue, 12 Apr 2022 20:16:49 +0000 (-0400) Subject: command-parser: Don't add duplicate command to command list X-Git-Tag: 23.51.283~89^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a1996600ebb85f98c297fa47122b99fbdf49c6ea;p=thirdparty%2Fplymouth.git command-parser: Don't add duplicate command to command list ply_command_parser_get_options inexplicably adds a duplicate command to the list of available subcommands every time it's called. This must be some sort of cut and paste bug, it shouldn't be modifying the list. That leads to double frees when freeing the command parser. This commit fixes that. Related: https://gitlab.freedesktop.org/plymouth/plymouth/-/issues/175 --- diff --git a/src/libply/ply-command-parser.c b/src/libply/ply-command-parser.c index 4fec7fe2..c4cf1036 100644 --- a/src/libply/ply-command-parser.c +++ b/src/libply/ply-command-parser.c @@ -663,8 +663,6 @@ ply_command_parser_get_command_options (ply_command_parser_t *parser, va_start (args, option_name); ply_command_parser_get_options_for_command (parser, command, option_name, args); va_end (args); - - ply_list_append_data (parser->available_subcommands, command); } static void