mirror of
git://sourceware.org/git/glibc.git
synced 2025-03-06 20:58:33 +01: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:
parent
85e6d8b417
commit
abcf8db7fa
1 changed files with 4 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue