monitor: Fix crash when using RTT backend
authorSzymon Janc <szymon.janc@codecoup.pl>
Fri, 24 Jun 2022 08:25:41 +0000 (10:25 +0200)
committerAyush Garg <ayush.garg@samsung.com>
Mon, 15 May 2023 09:25:54 +0000 (14:55 +0530)
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.

Signed-off-by: Manika Shrivastava <manika.sh@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
monitor/jlink.c

index f1d8ce6..f9d4037 100644 (file)
@@ -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;
 }