aboutsummaryrefslogtreecommitdiff
path: root/client.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-02-20 19:21:34 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-02-20 19:21:34 +0000
commit54fbfb6405f582fc6138f5c28a92e751e33ba687 (patch)
tree6953d37dc8921022c59deb2907b7e69a500ed4db /client.c
parentdoc: foot.5: login-shell: add default value ('no') (diff)
client: make sure 'cwd' is in scope of all goto's
Diffstat (limited to 'client.c')
-rw-r--r--client.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/client.c b/client.c
index 78750442..29b4e3b2 100644
--- a/client.c
+++ b/client.c
@@ -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;