mirror of
https://sourceware.org/git/glibc.git
synced 2025-01-18 14:40:06 +00:00
Fix descriptor leak when calling dlopen with RTLD_NOLOAD
This commit is contained in:
parent
b0f3a2e43f
commit
96961bf71d
@ -1,3 +1,8 @@
|
|||||||
|
2009-10-06 Andreas Schwab <schwab@redhat.com>
|
||||||
|
|
||||||
|
* elf/dl-load.c (_dl_map_object_from_fd): Close fd before
|
||||||
|
returning if RTLD_NOLOAD.
|
||||||
|
|
||||||
2009-10-06 Roland McGrath <roland@redhat.com>
|
2009-10-06 Roland McGrath <roland@redhat.com>
|
||||||
|
|
||||||
* sysdeps/x86_64/multiarch/strstr-c.c
|
* sysdeps/x86_64/multiarch/strstr-c.c
|
||||||
|
@ -903,9 +903,12 @@ _dl_map_object_from_fd (const char *name, int fd, struct filebuf *fbp,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (mode & RTLD_NOLOAD)
|
if (mode & RTLD_NOLOAD)
|
||||||
/* We are not supposed to load the object unless it is already
|
{
|
||||||
loaded. So return now. */
|
/* We are not supposed to load the object unless it is already
|
||||||
return NULL;
|
loaded. So return now. */
|
||||||
|
__close (fd);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
/* Print debugging message. */
|
/* Print debugging message. */
|
||||||
if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_FILES, 0))
|
if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_FILES, 0))
|
||||||
|
Loading…
Reference in New Issue
Block a user