diff mbox series

monitor: Fix crash when using RTT backend

Message ID 20220624082541.51687-1-szymon.janc@codecoup.pl
State New
Headers show
Series monitor: Fix crash when using RTT backend | expand

Commit Message

Szymon Janc June 24, 2022, 8:25 a.m. UTC
This fix regression introduced by "monitor: Fix memory leaks".
J-Link shared library is in use if jlink_init() returns 0 and thus
handle shall not be closed.
---
 monitor/jlink.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/monitor/jlink.c b/monitor/jlink.c
index f1d8ce660..f9d4037f4 100644
--- a/monitor/jlink.c
+++ b/monitor/jlink.c
@@ -112,7 +112,7 @@  int jlink_init(void)
 		return -EIO;
 	}
 
-	dlclose(so);
+	/* don't dlclose(so) here cause symbols from it are in use now */
 	return 0;
 }