Message ID | 20220531074117.610321-4-gopalkrishna.tiwari@gmail.com |
---|---|
State | Superseded |
Headers | show |
Series | Fixing memory leak, leaked_handle and use_after | expand |
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; }