about summary refs log tree commit diff
path: root/elf/dl-load.c
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@redhat.com>2011-02-25 20:49:48 -0500
committerUlrich Drepper <drepper@gmail.com>2011-02-25 20:49:48 -0500
commit4bff6e0175ed195871f4e01cc4c4c33274b8f6e3 (patch)
treec66f1fa828edf1592d7f73c4200c16ae2996f8b5 /elf/dl-load.c
parent661b9e2014b3964469198ce7697a1d0d06aa4882 (diff)
downloadglibc-4bff6e0175ed195871f4e01cc4c4c33274b8f6e3.tar.gz
glibc-4bff6e0175ed195871f4e01cc4c4c33274b8f6e3.tar.xz
glibc-4bff6e0175ed195871f4e01cc4c4c33274b8f6e3.zip
Fix memory leak in dlopen with RTLD_NOLOAD.
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 41b5ce7691..1ad16a0d65 100644
--- a/elf/dl-load.c
+++ b/elf/dl-load.c
@@ -894,6 +894,7 @@ _dl_map_object_from_fd (const char *name, int fd, struct filebuf *fbp,
     {
       /* We are not supposed to load the object unless it is already
 	 loaded.  So return now.  */
+      free (realname);
       __close (fd);
       return NULL;
     }
@@ -912,6 +913,7 @@ _dl_map_object_from_fd (const char *name, int fd, struct filebuf *fbp,
       _dl_zerofd = _dl_sysdep_open_zero_fill ();
       if (_dl_zerofd == -1)
 	{
+	  free (realname);
 	  __close (fd);
 	  _dl_signal_error (errno, NULL, NULL,
 			    N_("cannot open zero fill device"));