mirror of
git://sourceware.org/git/glibc.git
synced 2024-11-27 03:41:23 +08:00
e3f828b8bd
dlerror.c (__dlerror_main_freeres) will try to free resources which only
have been initialized when init () has been called. That function is
called when resources are needed using __libc_once (once, init) where
once is a __libc_once_define (static, once) in the dlerror.c file.
Trying to free those resources if init () hasn't been called will
produce errors under valgrind memcheck. So guard the freeing of those
resources using __libc_once_get (once) and make sure we have a valid
key. Also add a similar guard to __dlerror ().
* dlfcn/dlerror.c (__dlerror_main_freeres): Guard using
__libc_once_get (once) and static_bug == NULL.
(__dlerror): Check we have a valid key, set result to static_buf
otherwise.
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
(cherry picked from commit
|
||
---|---|---|
.. | ||
bug-atexit1-lib.c | ||
bug-atexit1.c | ||
bug-atexit2-lib.c | ||
bug-atexit2.c | ||
bug-atexit3-lib.cc | ||
bug-atexit3.c | ||
bug-dl-leaf-lib-cb.c | ||
bug-dl-leaf-lib.c | ||
bug-dl-leaf.c | ||
bug-dlopen1.c | ||
bug-dlsym1-lib1.c | ||
bug-dlsym1-lib2.c | ||
bug-dlsym1.c | ||
default.c | ||
defaultmod1.c | ||
defaultmod2.c | ||
dladdr1.c | ||
dladdr.c | ||
dlclose.c | ||
dlerror.c | ||
dlfcn.c | ||
dlfcn.h | ||
dlfreeres.c | ||
dlinfo.c | ||
dlmopen.c | ||
dlopen.c | ||
dlopenold.c | ||
dlsym.c | ||
dlvsym.c | ||
errmsg1.c | ||
errmsg1mod.c | ||
failtest.c | ||
failtestmod.c | ||
glreflib1.c | ||
glreflib2.c | ||
glreflib3.c | ||
glrefmain.c | ||
Makefile | ||
modatexit.c | ||
modcxaatexit.c | ||
moddummy1.c | ||
moddummy2.c | ||
modstatic2.c | ||
modstatic3.c | ||
modstatic5.c | ||
modstatic.c | ||
sdladdr1.c | ||
sdladdr.c | ||
sdlclose.c | ||
sdlerror.c | ||
sdlfreeres.c | ||
sdlinfo.c | ||
sdlmopen.c | ||
sdlopen.c | ||
sdlsym.c | ||
sdlvsym.c | ||
tst-dladdr.c | ||
tst-dlinfo.c | ||
tst-rec-dlopen.c | ||
tstatexit.c | ||
tstcxaatexit.c | ||
tststatic2.c | ||
tststatic3.c | ||
tststatic4.c | ||
tststatic5.c | ||
tststatic.c | ||
Versions |