mirror of
https://github.com/tmate-io/tmate.git
synced 2026-08-03 08:02:09 +00:00
Don't leak fd and path on failure.
This commit is contained in:
parent
69ea6b9373
commit
2a62917444
1 changed files with 5 additions and 1 deletions
6
client.c
6
client.c
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue