Memory leaks, from David CARLIER.

This commit is contained in:
nicm
2017-04-22 06:13:30 +00:00
parent c8ecbf38ab
commit 2c9bdd9e32
5 changed files with 26 additions and 14 deletions

View File

@ -119,12 +119,16 @@ server_create_socket(void)
return (-1);
mask = umask(S_IXUSR|S_IXGRP|S_IRWXO);
if (bind(fd, (struct sockaddr *) &sa, sizeof(sa)) == -1)
if (bind(fd, (struct sockaddr *) &sa, sizeof(sa)) == -1) {
close(fd);
return (-1);
}
umask(mask);
if (listen(fd, 128) == -1)
if (listen(fd, 128) == -1) {
close(fd);
return (-1);
}
setblocking(fd, 0);
return (fd);