uwrap: Avoid dclose(RTLD_NEXT) In case the libc was not found and RTLD_NEXT is used instead, we should not dlclose it, otherwise mayhem happens. Signed-off-by: Samuel Thibault diff --git a/src/uid_wrapper.c b/src/uid_wrapper.c index f04642a..dd87da4 100644 --- a/src/uid_wrapper.c +++ b/src/uid_wrapper.c @@ -2453,7 +2453,11 @@ void uwrap_destructor(void) } - if (uwrap.libc.handle != NULL) { + if (uwrap.libc.handle != NULL +#ifdef RTLD_NEXT + && uwrap.libc.handle != RTLD_NEXT +#endif + ) { dlclose(uwrap.libc.handle); }