If connect() in connect_namedsocket() return false, the sockfd will leak. Plug it.
Signed-off-by: Michael Tokarev <m...@tls.msk.ru> Signed-off-by: Gonglei <arei.gong...@huawei.com> --- hw/9pfs/virtio-9p-proxy.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/9pfs/virtio-9p-proxy.c b/hw/9pfs/virtio-9p-proxy.c index b57966d..e6bbb06 100644 --- a/hw/9pfs/virtio-9p-proxy.c +++ b/hw/9pfs/virtio-9p-proxy.c @@ -1112,6 +1112,7 @@ static int connect_namedsocket(const char *path) size = strlen(helper.sun_path) + sizeof(helper.sun_family); if (connect(sockfd, (struct sockaddr *)&helper, size) < 0) { fprintf(stderr, "socket error\n"); + close(sockfd); return -1; } -- 1.7.10.4