)]}'
{
  "commit": "2eeb2c99bb0fff2ff0afab5959a4c49c87035aab",
  "tree": "ae53a86aa83aa8e8dfab8efb024eaeb7004effb6",
  "parents": [
    "bf0a637f4d5f73b5242241bcec5a447a7531d5d2"
  ],
  "author": {
    "name": "Matthieu Longo",
    "email": "matthieu.longo@arm.com",
    "time": "Mon Feb 02 14:40:22 2026 +0000"
  },
  "committer": {
    "name": "Matthieu Longo",
    "email": "matthieu.longo@arm.com",
    "time": "Fri Feb 06 10:41:54 2026 +0000"
  },
  "message": "bfd: fix memory leak when assigning the merge result of OAv2 string attributes\n\noav2_attr_merge() merges input OAv2 attributes and returns a merge result,\nwhich is then assigned to the previous value held by REF.\n\nIn the current implementation of handle_optional_subsection_merge(), when\nmerging string attributes, the existing value is overwritten without first\nbeing freed. This results in a memory leak. This issue was detected by\nLeakSanitizer (see the relevant stack trace below).\n\nThis patch fixes the memory leak by wrapping the assignment of the merge\nresult to REF inside a helper function. For string attributes, the helper\nfrees the previous value before performing the assignment. This approach\nalso centralizes the logic and makes easier to correctly free and assign\nmore complex structures in the future, if needed.\n\n\u003d\u003dERROR: LeakSanitizer: detected memory leaks\nDirect leak of 12 byte(s) in 2 object(s) allocated from:\n    #2 xmemdup ../../libiberty/xmemdup.c:37\n    #3 read_ntbs ../../bfd/elf-attrs.c:2676\n    #4 oav2_parse_attr ../../bfd/elf-attrs.c:2699\n    #5 oav2_parse_subsection ../../bfd/elf-attrs.c:2845\n    #6 oav2_parse_section ../../bfd/elf-attrs.c:2883\n    #7 _bfd_elf_parse_attributes ../../bfd/elf-attrs.c:2947\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "6c3cfc09677c7d79294f1a2c2455cc1379cfb8b3",
      "old_mode": 33188,
      "old_path": "bfd/elf-attrs.c",
      "new_id": "e0847a04aecf7f0d2a18c4f478b82f595f1fbf8a",
      "new_mode": 33188,
      "new_path": "bfd/elf-attrs.c"
    }
  ]
}
