All of lore.kernel.org
 help / color / mirror / Atom feed
* [BlueZ PATCH] emulator: fix potential resource leak
@ 2021-11-16  6:49 Tedd Ho-Jeong An
  2021-11-16  7:35 ` [BlueZ] " bluez.test.bot
  0 siblings, 1 reply; 2+ messages in thread
From: Tedd Ho-Jeong An @ 2021-11-16  6:49 UTC (permalink / raw)
  To: linux-bluetooth

From: Tedd Ho-Jeong An <tedd.an@intel.com>

This patch releases the allocated fd to prevent the potential resource
leak. This was reported by the Coverity scan.
---
 emulator/vhci.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/emulator/vhci.c b/emulator/vhci.c
index 59ad1ecb8..014df87d2 100644
--- a/emulator/vhci.c
+++ b/emulator/vhci.c
@@ -140,8 +140,10 @@ struct vhci *vhci_open(uint8_t type)
 	}
 
 	vhci = malloc(sizeof(*vhci));
-	if (!vhci)
+	if (!vhci) {
+		close(fd);
 		return NULL;
+	}
 
 	memset(vhci, 0, sizeof(*vhci));
 	vhci->type = type;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* RE: [BlueZ] emulator: fix potential resource leak
  2021-11-16  6:49 [BlueZ PATCH] emulator: fix potential resource leak Tedd Ho-Jeong An
@ 2021-11-16  7:35 ` bluez.test.bot
  0 siblings, 0 replies; 2+ messages in thread
From: bluez.test.bot @ 2021-11-16  7:35 UTC (permalink / raw)
  To: linux-bluetooth, hj.tedd.an

[-- Attachment #1: Type: text/plain, Size: 884 bytes --]

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=580675

---Test result---

Test Summary:
CheckPatch                    PASS      1.43 seconds
GitLint                       PASS      1.01 seconds
Prep - Setup ELL              PASS      46.31 seconds
Build - Prep                  PASS      0.52 seconds
Build - Configure             PASS      8.83 seconds
Build - Make                  PASS      201.01 seconds
Make Check                    PASS      9.37 seconds
Make Distcheck                PASS      240.56 seconds
Build w/ext ELL - Configure   PASS      8.97 seconds
Build w/ext ELL - Make        PASS      190.08 seconds



---
Regards,
Linux Bluetooth


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-11-16  7:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-16  6:49 [BlueZ PATCH] emulator: fix potential resource leak Tedd Ho-Jeong An
2021-11-16  7:35 ` [BlueZ] " bluez.test.bot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.