diff options
author | Gopal Tiwari <gtiwari@redhat.com> | 2022-05-31 13:11:07 +0530 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2022-05-31 12:50:08 -0700 |
commit | 6f02010ce0043ec2e17eb15f2a1dd42f6c64e223 (patch) | |
tree | 03171f48ae4be70acda4f9927a42f11b22be3f61 /monitor | |
parent | 5eb96b3ec8545047a74d7204664267c7aa749070 (diff) | |
download | bluez-6f02010ce0043ec2e17eb15f2a1dd42f6c64e223.tar.gz |
monitor: Fix memory leaks
While performing static tool analysis using coverity
found following reports for resouse leak
bluez-5.64/monitor/jlink.c:111: leaked_storage: Variable "so"
going out of scope leaks the storage it points to.
bluez-5.64/monitor/jlink.c:113: leaked_storage: Variable "so"
going out of scope leaks the storage it points to.
Diffstat (limited to 'monitor')
-rw-r--r-- | monitor/jlink.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/monitor/jlink.c b/monitor/jlink.c index 9aaa4ebd8..f1d8ce660 100644 --- a/monitor/jlink.c +++ b/monitor/jlink.c @@ -107,9 +107,12 @@ int jlink_init(void) !jlink.tif_select || !jlink.setspeed || !jlink.connect || !jlink.getsn || !jlink.emu_getproductname || - !jlink.rtterminal_control || !jlink.rtterminal_read) + !jlink.rtterminal_control || !jlink.rtterminal_read) { + dlclose(so); return -EIO; + } + dlclose(so); return 0; } |