From 4d7ce4dd486816139276a2c5cf90e0213fb47b21 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Tue, 10 Oct 2000 15:23:38 +0000 Subject: [PATCH] * section.c (bfd_make_section_anyway): Release newsect ptr when newsect->symbol fails to alloc. Use bfd_release instead of free. --- bfd/ChangeLog | 5 +++++ bfd/section.c | 7 +++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 249a4bf..5ab46c3 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2000-10-10 Tom Rix + + * section.c (bfd_make_section_anyway): Release newsect ptr when + newsect->symbol fails to alloc. Use bfd_release instead of free. + 2000-10-09 Richard Henderson symbol = bfd_make_empty_symbol (abfd); if (newsect->symbol == NULL) - return NULL; + { + bfd_release (abfd, newsect); + return NULL; + } newsect->symbol->name = name; newsect->symbol->value = 0; newsect->symbol->section = newsect; @@ -805,7 +808,7 @@ bfd_make_section_anyway (abfd, name) if (BFD_SEND (abfd, _new_section_hook, (abfd, newsect)) != true) { - free (newsect); + bfd_release (abfd, newsect); return NULL; } -- 2.7.4