summaryrefslogtreecommitdiff
path: root/ldso/libdl/libdl.c
diff options
context:
space:
mode:
authorPhilip Craig <philipjcraig@gmail.com>2011-02-08 16:11:38 +1000
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2011-02-11 19:30:17 +0100
commitbb8551685e2efc42c65a01479b9f9bb8b860da01 (patch)
treee19a9e6a3eac522fb71b2743776f3624a78939ff /ldso/libdl/libdl.c
parent32814a2b15829df3a144391f5b8bd46e755f85f5 (diff)
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 <philipjcraig@gmail.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Diffstat (limited to 'ldso/libdl/libdl.c')
-rw-r--r--ldso/libdl/libdl.c4
1 files changed, 4 insertions, 0 deletions
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);