Fix crash during error handling

This commit is contained in:
Andreas Schwab 2011-09-08 12:02:26 +02:00
parent b49865be8e
commit 610f9ab43e
2 changed files with 5 additions and 1 deletions

View File

@ -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.

View File

@ -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);