aboutsummaryrefslogtreecommitdiff
path: root/elf/dl-load.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@gmail.com>2011-09-07 22:58:47 -0400
committerUlrich Drepper <drepper@gmail.com>2011-09-07 22:58:47 -0400
commitc966526aa40273e0da42dfd26fa8c0f409e69b86 (patch)
treeb754d8ca3cba598986828743b2d1e7b5469f492a /elf/dl-load.c
parent680f813ed3b9e6203e952c6d7275526ccc04d17f (diff)
downloadglibc-c966526aa40273e0da42dfd26fa8c0f409e69b86.tar
glibc-c966526aa40273e0da42dfd26fa8c0f409e69b86.tar.gz
glibc-c966526aa40273e0da42dfd26fa8c0f409e69b86.tar.bz2
glibc-c966526aa40273e0da42dfd26fa8c0f409e69b86.zip
Fix memory leak in case of failed dlopen
Diffstat (limited to 'elf/dl-load.c')
-rw-r--r--elf/dl-load.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/elf/dl-load.c b/elf/dl-load.c
index 24b3359d0b..7d7008dd75 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);