From: Paolo Bonzini Date: Mon, 5 Sep 2022 11:01:27 +0000 (+0200) Subject: tests: test-qga: close socket on failure to connect X-Git-Tag: v7.2.0-rc0~85^2~12 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5dc51100394206b4ca3fdcafb008de8f99fc4676;p=thirdparty%2Fqemu.git tests: test-qga: close socket on failure to connect Reported by Coverity as CID 1432543. Signed-off-by: Paolo Bonzini --- diff --git a/tests/unit/test-qga.c b/tests/unit/test-qga.c index a05a4628ed5..d27ff94d139 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);