mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-04-02 07:15:31 -04:00
main: free 'cwd' at exit
This fixes an issue where e.g. failing to initialize the Wayland backend would leave cwd un-free:d
This commit is contained in:
parent
ed620f1854
commit
74c3b4be1a
1 changed files with 2 additions and 1 deletions
3
main.c
3
main.c
|
|
@ -403,10 +403,10 @@ main(int argc, char *const *argv)
|
||||||
if (!as_server && (term = term_init(
|
if (!as_server && (term = term_init(
|
||||||
&conf, fdm, reaper, wayl, "foot", cwd, argc, argv,
|
&conf, fdm, reaper, wayl, "foot", cwd, argc, argv,
|
||||||
&term_shutdown_cb, &shutdown_ctx)) == NULL) {
|
&term_shutdown_cb, &shutdown_ctx)) == NULL) {
|
||||||
free(cwd);
|
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
free(cwd);
|
free(cwd);
|
||||||
|
cwd = NULL;
|
||||||
|
|
||||||
if (as_server && (server = server_init(&conf, fdm, reaper, wayl)) == NULL)
|
if (as_server && (server = server_init(&conf, fdm, reaper, wayl)) == NULL)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
@ -439,6 +439,7 @@ main(int argc, char *const *argv)
|
||||||
ret = aborted || tll_length(wayl->terms) == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
|
ret = aborted || tll_length(wayl->terms) == 0 ? EXIT_SUCCESS : EXIT_FAILURE;
|
||||||
|
|
||||||
out:
|
out:
|
||||||
|
free(cwd);
|
||||||
server_destroy(server);
|
server_destroy(server);
|
||||||
term_destroy(term);
|
term_destroy(term);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue