2021-11-16 06:49:52

by Tedd Ho-Jeong An

[permalink] [raw]
Subject: [BlueZ PATCH] emulator: fix potential resource leak

From: Tedd Ho-Jeong An <[email protected]>

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



2021-11-16 07:35:53

by bluez.test.bot

[permalink] [raw]
Subject: RE: [BlueZ] emulator: fix potential resource leak

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