You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
825 B
28 lines
825 B
commit abcf8db7fa46b73fd5b8193ce11f9312301b84c7
|
|
Author: Andreas Schwab <schwab@suse.de>
|
|
Date: Wed Jun 7 11:21:48 2023 +0200
|
|
|
|
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.
|
|
|
|
diff --git a/resolv/resolv_conf.c b/resolv/resolv_conf.c
|
|
index 9010bf0ea4d84557..aab79e9f4e323df9 100644
|
|
--- a/resolv/resolv_conf.c
|
|
+++ b/resolv/resolv_conf.c
|
|
@@ -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);
|
|
}
|