diff options
author | nicm <nicm> | 2015-09-24 12:06:20 +0000 |
---|---|---|
committer | nicm <nicm> | 2015-09-24 12:06:20 +0000 |
commit | 2a62917444783e62ea5b8c13069aecb77b47ff07 (patch) | |
tree | 145d1a2c94dee13a0c0990e3da94394d11350550 /client.c | |
parent | 69ea6b9373c0cc992932499b89330c26e27d6510 (diff) |
Don't leak fd and path on failure.
Diffstat (limited to 'client.c')
-rw-r--r-- | client.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -153,15 +153,19 @@ retry: } fd = server_start(base, lockfd, lockfile); } + if (locked) { free(lockfile); close(lockfd); } - setblocking(fd, 0); return (fd); failed: + if (locked) { + free(lockfile); + close(lockfd); + } close(fd); return (-1); } |