The vulnerability is described as a memory leak related to the function xstrdup in xstrdup.c. The provided patch (commit d4115c2c8d447e297ae353892de89192c1996211) addresses numerous memory leaks in the ld component of Binutils by replacing calls to xmalloc, xstrdup, and xmemdup with obstack-based allocation functions (stat_alloc, stat_strdup, stat_memdup). This change in memory management strategy implies that the previous manual freeing of memory allocated by xstrdup (and similar functions) was insufficient or incorrect, leading to leaks.
The function xstrdup itself is listed as it's the allocator mentioned in the CVE. The other functions (yylex, lang_memory_region_lookup, lang_memory_region_alias, add_excluded_libs, ldlang_add_undef, lang_add_unique) are identified as vulnerable because they were callers of xstrdup, xmemdup, or xmalloc (for string data) and were modified by the patch. These modifications strongly indicate that these functions were sites where memory was allocated but not properly freed, thus containing the memory leak vulnerability. The patch replaces these direct allocations with obstack allocations, where memory is managed in a larger pool and typically freed all at once, simplifying memory management and fixing the leaks.