aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2021-06-23 13:32:03 +0000
committerDaniel Eklöf <daniel@ekloef.se>2021-06-23 13:32:03 +0000
commit15e7e802456404d077bc23c6de01b5979f0a7484 (patch)
treed28fe238283ff33002c7caf3d1030bca40fe77cc
parentMerge branch 'footclient-override' (diff)
client: make sure ‘fd’ is initialized in all error paths
-rw-r--r--client.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/client.c b/client.c
index 7249c588..95c57656 100644
--- a/client.c
+++ b/client.c
@@ -136,6 +136,7 @@ main(int argc, char *const *argv)
uint64_t total_len = 0;
/* malloc:ed and needs to be in scope of all goto's */
+ int fd = -1;
char *_cwd = NULL;
override_list_t overrides = tll_init();
struct client_string *cargv = NULL;
@@ -279,7 +280,7 @@ main(int argc, char *const *argv)
log_init(log_colorize, false, LOG_FACILITY_USER, log_level);
- int fd = socket(AF_UNIX, SOCK_STREAM, 0);
+ fd = socket(AF_UNIX, SOCK_STREAM, 0);
if (fd == -1) {
LOG_ERRNO("failed to create socket");
goto err;