aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bfd/ChangeLog6
-rw-r--r--bfd/elfxx-riscv.c2
2 files changed, 7 insertions, 1 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index d760a4a..a72e811 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+2021-01-04 Alan Modra <amodra@gmail.com>
+
+ PR 26741
+ * elfxx-riscv.c (riscv_parse_prefixed_ext): Free subset after
+ calculating subset version length.
+
2021-01-01 Nicolas Boulenguez <nicolas@debian.org>
* xcofflink.c: Correct spelling in comments.
diff --git a/bfd/elfxx-riscv.c b/bfd/elfxx-riscv.c
index 9d7f606..101e27f 100644
--- a/bfd/elfxx-riscv.c
+++ b/bfd/elfxx-riscv.c
@@ -1572,8 +1572,8 @@ riscv_parse_prefixed_ext (riscv_parse_subset_t *rps,
riscv_parse_add_subset (rps, subset,
major_version,
minor_version, FALSE);
- free (subset);
p += end_of_version - subset;
+ free (subset);
if (*p != '\0' && *p != '_')
{