mirror of https://github.com/xemu-project/xemu.git
virtio-9p-proxy: Fix sockfd leak
If connect() in connect_namedsocket() return false, the sockfd will leak. Plug it. Signed-off-by: Michael Tokarev <mjt@tls.msk.ru> Signed-off-by: Gonglei <arei.gonglei@huawei.com>
This commit is contained in:
parent
8ef2b256b9
commit
660edd4eda
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue