mirror of
https://gitlab.freedesktop.org/plymouth/plymouth.git
synced 2026-05-08 13:38:45 +02:00
client: call cleanup functions everytime we return from main
We were not cleaning up allocated resources in many of the code execution paths in main()
This commit is contained in:
parent
bce1856745
commit
ed7b1690f0
1 changed files with 12 additions and 6 deletions
|
|
@ -1065,7 +1065,8 @@ main (int argc,
|
|||
ply_error ("%s", help_string);
|
||||
|
||||
free (help_string);
|
||||
return 1;
|
||||
exit_code = 1;
|
||||
goto out;
|
||||
}
|
||||
|
||||
ply_command_parser_get_options (state.command_parser,
|
||||
|
|
@ -1097,7 +1098,7 @@ main (int argc,
|
|||
printf ("%s", help_string);
|
||||
|
||||
free (help_string);
|
||||
return 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (ply_kernel_command_line_has_argument ("plymouth.debug") && !ply_is_tracing ())
|
||||
|
|
@ -1108,7 +1109,7 @@ main (int argc,
|
|||
|
||||
if (should_get_plugin_path) {
|
||||
printf ("%s\n", PLYMOUTH_PLUGIN_PATH);
|
||||
return 0;
|
||||
goto out;
|
||||
}
|
||||
|
||||
is_connected = ply_boot_client_connect (state.client,
|
||||
|
|
@ -1119,15 +1120,17 @@ main (int argc,
|
|||
|
||||
if (should_ping) {
|
||||
ply_trace ("ping failed");
|
||||
return 1;
|
||||
exit_code = 1;
|
||||
goto out;
|
||||
}
|
||||
if (should_check_for_active_vt) {
|
||||
ply_trace ("has active vt? failed");
|
||||
return 1;
|
||||
exit_code = 1;
|
||||
goto out;
|
||||
}
|
||||
if (should_wait) {
|
||||
ply_trace ("no need to wait");
|
||||
return 0;
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1215,6 +1218,9 @@ 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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue