mirror of
git://sourceware.org/git/glibc.git
synced 2025-01-18 12:16:13 +08:00
__cxa_thread_atexit_impl: Abort on allocation failure [BZ #18524]
Abort in the unlikely event that allocation fails when trying to register a TLS destructor. Reviewed-by: Florian Weimer <fweimer@redhat.com>
This commit is contained in:
parent
fb1621a886
commit
4aedc25f55
@ -72,6 +72,7 @@
|
||||
is not very different from a case where __call_tls_dtors is called after
|
||||
_dl_close_worker on the DSO and hence is an accepted execution. */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <ldsodefs.h>
|
||||
|
||||
@ -104,6 +105,9 @@ __cxa_thread_atexit_impl (dtor_func func, void *obj, void *dso_symbol)
|
||||
|
||||
/* Prepend. */
|
||||
struct dtor_list *new = calloc (1, sizeof (struct dtor_list));
|
||||
if (__glibc_unlikely (new == NULL))
|
||||
__libc_fatal ("Fatal glibc error: failed to register TLS destructor: "
|
||||
"out of memory\n");
|
||||
new->func = func;
|
||||
new->obj = obj;
|
||||
new->next = tls_dtor_list;
|
||||
|
Loading…
Reference in New Issue
Block a user