summaryrefslogtreecommitdiff
path: root/source3/rpc_server
diff options
context:
space:
mode:
Diffstat (limited to 'source3/rpc_server')
-rw-r--r--source3/rpc_server/rpc_sock_helper.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source3/rpc_server/rpc_sock_helper.c b/source3/rpc_server/rpc_sock_helper.c
index 198df903ad..dc88f25a90 100644
--- a/source3/rpc_server/rpc_sock_helper.c
+++ b/source3/rpc_server/rpc_sock_helper.c
@@ -63,6 +63,9 @@ NTSTATUS rpc_create_tcpip_sockets(const struct ndr_interface_table *iface,
fd = create_tcpip_socket(ifss, &p);
if (fd < 0 || p == 0) {
status = NT_STATUS_UNSUCCESSFUL;
+ if (fd != -1) {
+ close(fd);
+ }
goto done;
}
listen_fd[*listen_fd_size] = fd;
@@ -124,6 +127,9 @@ NTSTATUS rpc_create_tcpip_sockets(const struct ndr_interface_table *iface,
fd = create_tcpip_socket(&ss, &p);
if (fd < 0 || p == 0) {
status = NT_STATUS_UNSUCCESSFUL;
+ if (fd != -1) {
+ close(fd);
+ }
goto done;
}
listen_fd[*listen_fd_size] = fd;