Browse Source

fix stale pointer issue in dynamic linker with dlopen

Rich Felker 13 years ago
parent
commit
9e17b71fa6
1 changed files with 1 additions and 0 deletions
  1. 1 0
      src/ldso/dynlink.c

+ 1 - 0
src/ldso/dynlink.c

@@ -473,6 +473,7 @@ void *__dynlink(int argc, char **argv, size_t *got)
 		*libc->prev->next = *libc;
 		libc = libc->prev->next;
 		if (libc->next) libc->next->prev = libc;
+		if (tail == &lib) tail = libc;
 	} else {
 		free_all(head);
 		free(sys_path);