From 18e9e427e2355afab0c17ffaa85d3120837e292c Mon Sep 17 00:00:00 2001 From: tangbinzy Date: Mon, 9 Sep 2024 07:41:17 +0000 Subject: [PATCH] tests: test-qga: close socket on failure to connect mainline inclusion commit 5dc51100394206b4ca3fdcafb008de8f99fc4676 category: bugfix --------------------------------------------------------------- Reported by Coverity as CID 1432543. Signed-off-by: Paolo Bonzini Signed-off-by: tangbinzy --- tests/unit/test-qga.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/unit/test-qga.c b/tests/unit/test-qga.c index 5cb140d1b5..e6564c673b 100644 --- a/tests/unit/test-qga.c +++ b/tests/unit/test-qga.c @@ -32,6 +32,7 @@ static int connect_qga(char *path) g_usleep(G_USEC_PER_SEC); } if (i++ == 10) { + close(s); return -1; } } while (ret == -1); -- 2.41.0.windows.1