In case the libc was not found and RTLD_NEXT is used instead, we should not
dlclose it, otherwise mayhem happens.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15228
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
}
- if (uwrap.libc.handle != NULL) {
+ if (uwrap.libc.handle != NULL
+#ifdef RTLD_NEXT
+ && uwrap.libc.handle != RTLD_NEXT
+#endif
+ ) {
dlclose(uwrap.libc.handle);
}