mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-28 00:21:52 +03:00
resolv_conf: release lock on allocation failure (bug 30527)
When the initial allocation of global fails, the local lock is left locked. Reported by Steffen Lammel of SAP HANA development.
This commit is contained in:
@ -93,7 +93,10 @@ get_locked_global (void)
|
||||
{
|
||||
global_copy = calloc (1, sizeof (*global));
|
||||
if (global_copy == NULL)
|
||||
return NULL;
|
||||
{
|
||||
__libc_lock_unlock (lock);
|
||||
return NULL;
|
||||
}
|
||||
atomic_store_relaxed (&global, global_copy);
|
||||
resolv_conf_array_init (&global_copy->array);
|
||||
}
|
||||
|
Reference in New Issue
Block a user