summaryrefslogtreecommitdiff
path: root/binutils/objcopy.c
diff options
context:
space:
mode:
Diffstat (limited to 'binutils/objcopy.c')
-rw-r--r--binutils/objcopy.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/binutils/objcopy.c b/binutils/objcopy.c
index 957fb851432..d4fc644640c 100644
--- a/binutils/objcopy.c
+++ b/binutils/objcopy.c
@@ -4667,6 +4667,7 @@ write_debugging_info (bfd *obfd, void *dhandle,
flags = SEC_HAS_CONTENTS | SEC_READONLY | SEC_DEBUGGING;
stabsec = bfd_make_section_with_flags (obfd, ".stab", flags);
stabstrsec = bfd_make_section_with_flags (obfd, ".stabstr", flags);
+ ret = true;
if (stabsec == NULL
|| stabstrsec == NULL
|| !bfd_set_section_size (stabsec, symsize)
@@ -4676,18 +4677,17 @@ write_debugging_info (bfd *obfd, void *dhandle,
{
bfd_nonfatal_message (NULL, obfd, NULL,
_("can't create debugging section"));
- free (strings);
- return false;
+ ret = false;
}
/* We can get away with setting the section contents now because
the next thing the caller is going to do is copy over the
real sections. We may someday have to split the contents
setting out of this function. */
- ret = true;
- if (! bfd_set_section_contents (obfd, stabsec, syms, 0, symsize)
- || ! bfd_set_section_contents (obfd, stabstrsec, strings, 0,
- stringsize))
+ if (ret
+ && (!bfd_set_section_contents (obfd, stabsec, syms, 0, symsize)
+ || !bfd_set_section_contents (obfd, stabstrsec, strings, 0,
+ stringsize)))
{
bfd_nonfatal_message (NULL, obfd, NULL,
_("can't set debugging section contents"));