diff mbox series

[1/3] rasdaemon: ras-report: fix possible but unlikely file descriptor leak

Message ID 20220720143957.868734458@redhat.com (mailing list archive)
State New, archived
Headers show
Series rasdaemon: misc fixes | expand

Commit Message

'arozansk@redhat.com' July 20, 2022, 2:39 p.m. UTC
Found with covscan.

Signed-off-by: Aristeu Rozanski <arozansk@redhat.com>
diff mbox series

Patch

diff --git a/ras-report.c b/ras-report.c
index ea3a9b6..0088745 100644
--- a/ras-report.c
+++ b/ras-report.c
@@ -768,7 +768,7 @@  int ras_report_mf_event(struct ras_events *ras, struct ras_mf_event *ev)
 	done = 1;
 
 mf_fail:
-	if (sockfd > 0)
+	if (sockfd >= 0)
 		close(sockfd);
 
 	if (done)