Extends commit
6136093c0d00 to handle verdefs as well as verrefs.
PR 30886
* elf.c (_bfd_elf_slurp_version_tables): See free_contents for
verdefs too. Use free_contents rather than elf_tdata fields.
}
elf_tdata (abfd)->cverrefs = i;
- if (elf_tdata (abfd)->dt_verneed == NULL)
+ if (free_contents)
free (contents);
contents = NULL;
}
if (contents == NULL)
goto error_return_verdef;
+ free_contents = true;
BFD_ASSERT (sizeof (Elf_External_Verdef)
>= sizeof (Elf_External_Verdaux));
((bfd_byte *) everdef + iverdef->vd_next));
}
- if (elf_tdata (abfd)->dt_verdef == NULL)
+ if (free_contents)
free (contents);
contents = NULL;
}