]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
command-parser: Don't add duplicate command to command list
authorRay Strode <rstrode@redhat.com>
Tue, 12 Apr 2022 20:16:49 +0000 (16:16 -0400)
committerRay Strode <rstrode@redhat.com>
Tue, 12 Apr 2022 20:20:20 +0000 (16:20 -0400)
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

src/libply/ply-command-parser.c

index 4fec7fe2444d780abf761da2d3bd9daea6e620d8..c4cf10369ef0a458a5eb82508b877ceb43e894f0 100644 (file)
@@ -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