mirror of
https://github.com/tmux/tmux.git
synced 2025-09-03 14:27:09 +00:00
Don't leak fd and path on failure.
This commit is contained in:
6
client.c
6
client.c
@ -153,15 +153,19 @@ retry:
|
|||||||
}
|
}
|
||||||
fd = server_start(base, lockfd, lockfile);
|
fd = server_start(base, lockfd, lockfile);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (locked) {
|
if (locked) {
|
||||||
free(lockfile);
|
free(lockfile);
|
||||||
close(lockfd);
|
close(lockfd);
|
||||||
}
|
}
|
||||||
|
|
||||||
setblocking(fd, 0);
|
setblocking(fd, 0);
|
||||||
return (fd);
|
return (fd);
|
||||||
|
|
||||||
failed:
|
failed:
|
||||||
|
if (locked) {
|
||||||
|
free(lockfile);
|
||||||
|
close(lockfd);
|
||||||
|
}
|
||||||
close(fd);
|
close(fd);
|
||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user