mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-22 05:33:45 -04:00
client: make sure 'cwd' is in scope of all goto's
This commit is contained in:
parent
3f3f1add9c
commit
54fbfb6405
1 changed files with 3 additions and 1 deletions
4
client.c
4
client.c
|
|
@ -115,6 +115,9 @@ main(int argc, char *const *argv)
|
||||||
|
|
||||||
log_init(log_colorize, false, LOG_FACILITY_USER, LOG_CLASS_WARNING);
|
log_init(log_colorize, false, LOG_FACILITY_USER, LOG_CLASS_WARNING);
|
||||||
|
|
||||||
|
/* malloc:ed and needs to be in scope of all goto's */
|
||||||
|
char *cwd = NULL;
|
||||||
|
|
||||||
int fd = socket(AF_UNIX, SOCK_STREAM, 0);
|
int fd = socket(AF_UNIX, SOCK_STREAM, 0);
|
||||||
if (fd == -1) {
|
if (fd == -1) {
|
||||||
LOG_ERRNO("failed to create socket");
|
LOG_ERRNO("failed to create socket");
|
||||||
|
|
@ -151,7 +154,6 @@ main(int argc, char *const *argv)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
char *cwd = NULL;
|
|
||||||
{
|
{
|
||||||
errno = 0;
|
errno = 0;
|
||||||
size_t buf_len = 1024;
|
size_t buf_len = 1024;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue