From a0f2339011a80a8aa21f403557eb667277c79530 Mon Sep 17 00:00:00 2001 From: mugitya03 Date: Wed, 26 Feb 2025 19:34:44 -0500 Subject: [PATCH] Free pointer `lib` before function returns. In function main, the pointer lib allocated at line 7 is passed as an argument to functions uv_dlopen at line 10, uv_dlerror at lines 11 and 17, and uv_dlsym at line 16, but it is never freed before the function returns at line 24. This results in a memory leak bug. --- docs/code/plugin/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/code/plugin/main.c b/docs/code/plugin/main.c index 06e581e6..0a2341fb 100644 --- a/docs/code/plugin/main.c +++ b/docs/code/plugin/main.c @@ -34,6 +34,6 @@ int main(int argc, char **argv) { init_plugin(); } - + free(lib); return 0; }