Don't leak fd and path on failure.

This commit is contained in:
nicm 2015-09-24 12:06:20 +00:00
parent 69ea6b9373
commit 2a62917444

View File

@ -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);
}