diff --git a/binutils/ChangeLog b/binutils/ChangeLog index f1e1f9bd3f..09f76b9221 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,8 @@ +2016-11-04 Andrew Burgess + + * objcopy.c (copy_section): Add extra calls to free for error + paths. + 2016-11-04 Tom Tromey * dwarf-mode.el (dwarf-browse): Set default-directory. Bump diff --git a/binutils/objcopy.c b/binutils/objcopy.c index 1821c0ce1b..d40cfcb2bb 100644 --- a/binutils/objcopy.c +++ b/binutils/objcopy.c @@ -3375,6 +3375,7 @@ copy_section (bfd *ibfd, sec_ptr isection, void *obfdarg) { status = 1; bfd_nonfatal_message (NULL, ibfd, isection, NULL); + free (memhunk); return; } @@ -3428,6 +3429,7 @@ copy_section (bfd *ibfd, sec_ptr isection, void *obfdarg) { status = 1; bfd_nonfatal_message (NULL, obfd, osection, NULL); + free (memhunk); return; } free (memhunk); @@ -3449,6 +3451,7 @@ copy_section (bfd *ibfd, sec_ptr isection, void *obfdarg) { status = 1; bfd_nonfatal_message (NULL, obfd, osection, NULL); + free (memhunk); return; } free (memhunk);