diff mbox series

[05/19] Removed a resource leak from nfs/svc_socket.c

Message ID 20190508133536.6077-6-steved@redhat.com (mailing list archive)
State New, archived
Headers show
Series Covertity Scan: Removed resources leaks | expand

Commit Message

Steve Dickson May 8, 2019, 1:35 p.m. UTC
nfs/svc_socket.c:137: leaked_handle: Handle variable "sock"
	going out of scope leaks the handle.

Signed-off-by: Steve Dickson <steved@redhat.com>
---
 support/nfs/svc_socket.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/support/nfs/svc_socket.c b/support/nfs/svc_socket.c
index d56507a..5afc6aa 100644
--- a/support/nfs/svc_socket.c
+++ b/support/nfs/svc_socket.c
@@ -134,6 +134,7 @@  svc_socket (u_long number, int type, int protocol, int reuse)
       if (ret < 0)
 	{
 	  xlog(L_ERROR, "svc_socket: socket reuse problem: %m");
+      (void) __close(sock);
 	  return ret;
 	}
     }