From bb8551685e2efc42c65a01479b9f9bb8b860da01 Mon Sep 17 00:00:00 2001 From: Philip Craig Date: Tue, 8 Feb 2011 16:11:38 +1000 Subject: Fix memory leak in dlopen()/dlclose(). The linked list of library dependencies created by dlopen() was not being freed by dlclose(). Signed-off-by: Philip Craig Signed-off-by: Bernhard Reutner-Fischer --- ldso/libdl/libdl.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ldso/libdl/libdl.c b/ldso/libdl/libdl.c index b88bc4819..ee5cd447a 100644 --- a/ldso/libdl/libdl.c +++ b/ldso/libdl/libdl.c @@ -922,6 +922,10 @@ static int do_dlclose(void *vhandle, int need_fini) free(tpnt); } } + for (rpnt1 = handle->next; rpnt1; rpnt1 = rpnt1_tmp) { + rpnt1_tmp = rpnt1->next; + free(rpnt1); + } free(handle->init_fini.init_fini); free(handle); -- cgit v1.2.3