From 2974f525ec703329ef6ad079d8f6c685cfab11ad Mon Sep 17 00:00:00 2001 From: Costa Tsaousis Date: Thu, 13 Oct 2022 08:04:14 +0300 Subject: overload libc memory allocators with custom ones to trace all allocations (#13810) * overload libc memory allocators with custom ones to trace all allocations * grab libc pointers for external c plugins * use -ldl when necessary; fallback to work without dlsym when it is not available * initialize global variable * add optional dl libs * dynamically link every library function when needed for the first time * prevent crashes on musl libc * another attempt * dont dereference function * attempt no 3 * attempt no 4 * cleanup - all attempts failed * dont enable tracing of allocations * missing parenthesis --- collectors/apps.plugin/apps_plugin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'collectors') diff --git a/collectors/apps.plugin/apps_plugin.c b/collectors/apps.plugin/apps_plugin.c index 212374e828..2bc499a77d 100644 --- a/collectors/apps.plugin/apps_plugin.c +++ b/collectors/apps.plugin/apps_plugin.c @@ -2935,7 +2935,7 @@ static size_t zero_all_targets(struct target *root) { while(pid_on_target) { pid_on_target_to_free = pid_on_target; pid_on_target = pid_on_target->next; - free(pid_on_target_to_free); + freez(pid_on_target_to_free); } w->root_pid = NULL; -- cgit v1.2.3