[PATCH v1 3/7] bfd: fix memory leak when assigning the merge result of OAv2 string attributes

Jan Beulich jbeulich@suse.com
Thu Feb 5 10:46:04 GMT 2026


On 03.02.2026 11:00, Matthieu Longo wrote:
> --- a/bfd/elf-attrs.c
> +++ b/bfd/elf-attrs.c
> @@ -1467,6 +1467,19 @@ oav2_search_by_tag (obj_attr_v2_t *attr_first, obj_attr_tag_t tag)
>    return NULL;
>  }
>  
> +/* Assign the merge result to REF.
> +   The only reason to exist for this helper is when the manipulated value is a
> +   string.  In this case, the value in REF must be freed before assigning.  */
> +static void
> +oav2_attr_assign_merge_result (obj_attr_encoding_v2_t encoding,

The "attr" in the name looks to be redundant with the 'a' in "oav2". Is there a
particular reason for this?

> +			       obj_attr_v2_t *a_ref,
> +			       obj_attr_v2_merge_result_t *res)

As before - pointer-to-const please wherever sensible and possible.

Okay with respective adjustments or (for the former remark) clarification.

Jan


More information about the Binutils mailing list