about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@redhat.com>2011-09-08 12:02:26 +0200
committerAndreas Schwab <schwab@redhat.com>2011-09-08 12:03:11 +0200
commit610f9ab43eb24b8e94d0067d2c785ab4fdc411dc (patch)
treeb556e96087b8b73a79f9f097d26ea5ab51beca4c
parentb49865be8e798e567a23c01f188546aef514ba06 (diff)
downloadglibc-610f9ab43eb24b8e94d0067d2c785ab4fdc411dc.tar.gz
glibc-610f9ab43eb24b8e94d0067d2c785ab4fdc411dc.tar.xz
glibc-610f9ab43eb24b8e94d0067d2c785ab4fdc411dc.zip
Fix crash during error handling
-rw-r--r--ChangeLog4
-rw-r--r--elf/dl-load.c2
2 files changed, 5 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 94d502ac6f..91328e0483 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2011-09-08  Andreas Schwab  <schwab@redhat.com>
+
+	* elf/dl-load.c (lose): Check for non-null l.
+
 2011-09-07  Ulrich Drepper  <drepper@gmail.com>
 
 	* elf/dl-load.c (open_verify): Use O_CLOEXEC.
diff --git a/elf/dl-load.c b/elf/dl-load.c
index e8d0401f24..b8a2659af1 100644
--- a/elf/dl-load.c
+++ b/elf/dl-load.c
@@ -888,7 +888,7 @@ 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)
+  if (l != NULL && l->l_origin != (char *) -1l)
     free (l->l_origin);
   free (l);
   free (realname);