PR 26069
* objcopy.c (copy_relocations_in_section): Free relpp on error.
Don't accidentally free isection->orelocation.
+2020-06-03 Alan Modra <amodra@gmail.com>
+
+ PR 26069
+ * objcopy.c (copy_relocations_in_section): Free relpp on error.
+ Don't accidentally free isection->orelocation.
+
2020-06-02 Alan Modra <amodra@gmail.com>
* testsuite/binutils-all/ar.exp (obj): Set up object file name
status = 1;
bfd_nonfatal_message (NULL, ibfd, isection,
_("relocation count is negative"));
+ free (relpp);
return;
}
}
temp_relpp [temp_relcount++] = relpp [i];
}
relcount = temp_relcount;
- if (isection->orelocation == NULL)
+ if (relpp != isection->orelocation)
free (relpp);
relpp = temp_relpp;
}
if (relcount == 0)
{
osection->flags &= ~SEC_RELOC;
- free (relpp);
+ if (relpp != isection->orelocation)
+ free (relpp);
}
}
}