From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Subject: [PATCH] tests: test-qga: close socket on failure to connect
Date: Mon, 5 Sep 2022 13:01:51 +0200 [thread overview]
Message-ID: <20220905110151.32225-1-pbonzini@redhat.com> (raw)
Reported by Coverity as CID 1432543.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
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 a05a4628ed..d27ff94d13 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.37.2
next reply other threads:[~2022-09-05 11:28 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-05 11:01 Paolo Bonzini [this message]
2022-09-05 11:36 ` [PATCH] tests: test-qga: close socket on failure to connect Marc-André Lureau
2022-09-05 12:29 ` Paolo Bonzini
2022-09-05 12:36 ` Marc-André Lureau
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220905110151.32225-1-pbonzini@redhat.com \
--to=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).