Hi Aaron,

On Fri, 2026-10-30 at 12:08 -0400, Aaron Merey wrote:
> Signed-off-by: Aaron Merey <[email protected]>
> ---
>  libasm/asm_newabssym.c | 5 ++++-
>  libasm/asm_newcomsym.c | 5 ++++-
>  2 files changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/libasm/asm_newabssym.c b/libasm/asm_newabssym.c
> index 728d6043..38628f5f 100644
> --- a/libasm/asm_newabssym.c
> +++ b/libasm/asm_newabssym.c
> @@ -73,7 +73,10 @@ asm_newabssym (AsmCtx_t *ctx, const char *name, GElf_Xword 
> size,
>  
>    result = malloc (sizeof (AsmSym_t));
>    if (result == NULL)
> -    return NULL;
> +    {
> +      rwlock_unlock (ctx->lock);
> +      return NULL;
> +    }
>  
>    result->scn = (AsmScn_t *) &__libasm_abs_scn;
>    result->size = size;

Yes, this is the only early return under the lock in asm_newabssym that
is missing the unlock.

> diff --git a/libasm/asm_newcomsym.c b/libasm/asm_newcomsym.c
> index 750a1380..b4c6e82b 100644
> --- a/libasm/asm_newcomsym.c
> +++ b/libasm/asm_newcomsym.c
> @@ -73,7 +73,10 @@ asm_newcomsym (AsmCtx_t *ctx, const char *name, GElf_Xword 
> size,
>  
>    result = malloc (sizeof (AsmSym_t));
>    if (result == NULL)
> -    return NULL;
> +    {
> +      rwlock_unlock (ctx->lock);
> +      return NULL;
> +    }
>  
>    result->scn = (AsmScn_t *) &__libasm_com_scn;
>    result->size = size;

Likewise for asm_newcomsym.

So looks OK, thanks.

Cheers,

Mark

Reply via email to