projects
/
platform
/
upstream
/
bluez.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
33d847e
)
emulator: fix potential resource leak
author
Tedd Ho-Jeong An
<tedd.an@intel.com>
Tue, 16 Nov 2021 06:49:49 +0000
(22:49 -0800)
committer
Ayush Garg
<ayush.garg@samsung.com>
Fri, 11 Mar 2022 13:38:38 +0000
(19:08 +0530)
This patch releases the allocated fd to prevent the potential resource
leak. This was reported by the Coverity scan.
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
emulator/vhci.c
patch
|
blob
|
history
diff --git
a/emulator/vhci.c
b/emulator/vhci.c
index
59ad1ec
..
014df87
100755
(executable)
--- 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;