client: make sure 'cwd' is in scope of all goto's

This commit is contained in:
Daniel Eklöf 2020-02-20 20:21:34 +01:00
parent 3f3f1add9c
commit 54fbfb6405
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -115,6 +115,9 @@ main(int argc, char *const *argv)
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);
if (fd == -1) {
LOG_ERRNO("failed to create socket");
@ -151,7 +154,6 @@ main(int argc, char *const *argv)
}
}
char *cwd = NULL;
{
errno = 0;
size_t buf_len = 1024;