resolv_conf: release lock on allocation failure (bug 30527)
Checks
Context |
Check |
Description |
redhat-pt-bot/TryBot-apply_patch |
success
|
Patch applied to master at the time it was sent
|
redhat-pt-bot/TryBot-32bit |
success
|
Build for i686
|
linaro-tcwg-bot/tcwg_glibc_build--master-arm |
success
|
Testing passed
|
linaro-tcwg-bot/tcwg_glibc_build--master-aarch64 |
success
|
Testing passed
|
linaro-tcwg-bot/tcwg_glibc_check--master-aarch64 |
success
|
Testing passed
|
linaro-tcwg-bot/tcwg_glibc_check--master-arm |
fail
|
Patch failed to apply
|
Commit Message
When the initial allocation of global fails, the local lock is left
locked.
---
resolv/resolv_conf.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
Comments
* Andreas Schwab via Libc-alpha:
> When the initial allocation of global fails, the local lock is left
> locked.
> ---
> resolv/resolv_conf.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/resolv/resolv_conf.c b/resolv/resolv_conf.c
> index bd5890773b..8bc9edc634 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);
> }
> --
Okay.
Thanks,
Florian
@@ -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);
}