From c966526aa40273e0da42dfd26fa8c0f409e69b86 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 7 Sep 2011 22:58:47 -0400 Subject: [PATCH] Fix memory leak in case of failed dlopen --- ChangeLog | 3 +++ NEWS | 2 +- elf/dl-load.c | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 8062781..7e77bc9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2011-09-07 Ulrich Drepper + [BZ #13123] + * elf/dl-load.c (lose): Free l_origin if it is valid. + * sysdeps/i386/i686/multiarch/strchr-sse2-bsf.S: Fix mixup in section names. * sysdeps/i386/i686/multiarch/strchr-sse2.S: Likewise. diff --git a/NEWS b/NEWS index bd8ee5b..6e2ab66 100644 --- a/NEWS +++ b/NEWS @@ -10,7 +10,7 @@ Version 2.15 * The following bugs are resolved with this release: 9696, 12868, 12852, 12874, 12885, 12907, 12922, 12935, 13007, 13021, - 13068, 13092, 13114, 13134, 13150 + 13068, 13092, 13114, 13123, 13134, 13150 * New program pldd to list loaded object of a process Implemented by Ulrich Drepper. diff --git a/elf/dl-load.c b/elf/dl-load.c index 24b3359..7d7008d 100644 --- a/elf/dl-load.c +++ b/elf/dl-load.c @@ -888,6 +888,8 @@ lose (int code, int fd, const char *name, char *realname, struct link_map *l, /* The file might already be closed. */ if (fd != -1) (void) __close (fd); + if (l->l_origin != (char *) -1l) + free (l->l_origin); free (l); free (realname); -- 2.7.4