mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-04 04:06:06 -05:00
client: make sure ‘fd’ is initialized in all error paths
This commit is contained in:
parent
68494956b7
commit
15e7e80245
1 changed files with 2 additions and 1 deletions
3
client.c
3
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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue