diff mbox series

[01/11] test-util-sockets: Plug file descriptor leak

Message ID 20201029133833.3450220-2-armbru@redhat.com
State Accepted
Commit 9ce22da0d834f0c9f57bd36f5d0d10e5e2f4992c
Headers show
Series sockets: Attempt to drain the abstract socket swamp | expand

Commit Message

Markus Armbruster Oct. 29, 2020, 1:38 p.m. UTC
Fixes: 4d3a329af59ef8acd076f99f05e82531d8129b34
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 tests/test-util-sockets.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Eric Blake Oct. 29, 2020, 5:59 p.m. UTC | #1
On 10/29/20 8:38 AM, Markus Armbruster wrote:
> Fixes: 4d3a329af59ef8acd076f99f05e82531d8129b34

> Signed-off-by: Markus Armbruster <armbru@redhat.com>

> ---

>  tests/test-util-sockets.c | 1 +

>  1 file changed, 1 insertion(+)


Only a test bug, but a bug nonetheless, so appropriate for 5.2

Reviewed-by: Eric Blake <eblake@redhat.com>


> 

> diff --git a/tests/test-util-sockets.c b/tests/test-util-sockets.c

> index f6336e0f91..15da867b8f 100644

> --- a/tests/test-util-sockets.c

> +++ b/tests/test-util-sockets.c

> @@ -252,6 +252,7 @@ static gpointer unix_server_thread_func(gpointer user_data)

>  

>      connfd = accept(fd, (struct sockaddr *)&un, &len);

>      g_assert_cmpint(connfd, !=, -1);

> +    close(connfd);

>  

>      close(fd);

>  

> 


-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org
diff mbox series

Patch

diff --git a/tests/test-util-sockets.c b/tests/test-util-sockets.c
index f6336e0f91..15da867b8f 100644
--- a/tests/test-util-sockets.c
+++ b/tests/test-util-sockets.c
@@ -252,6 +252,7 @@  static gpointer unix_server_thread_func(gpointer user_data)
 
     connfd = accept(fd, (struct sockaddr *)&un, &len);
     g_assert_cmpint(connfd, !=, -1);
+    close(connfd);
 
     close(fd);