diff options
author | Alan Modra <amodra@gmail.com> | 2000-10-10 15:23:38 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2000-10-10 15:23:38 +0000 |
commit | 4d7ce4dd486816139276a2c5cf90e0213fb47b21 (patch) | |
tree | df10a1534ae2e9b13335ba2e460c94e3ed03b753 /bfd/section.c | |
parent | 120abad8b7c1433b48d5d1c8fb43b19b20feccd9 (diff) | |
download | gdb-4d7ce4dd486816139276a2c5cf90e0213fb47b21.zip gdb-4d7ce4dd486816139276a2c5cf90e0213fb47b21.tar.gz gdb-4d7ce4dd486816139276a2c5cf90e0213fb47b21.tar.bz2 |
* section.c (bfd_make_section_anyway): Release newsect ptr when
newsect->symbol fails to alloc. Use bfd_release instead of free.
Diffstat (limited to 'bfd/section.c')
-rw-r--r-- | bfd/section.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/bfd/section.c b/bfd/section.c index 4c858f6..fc64b20 100644 --- a/bfd/section.c +++ b/bfd/section.c @@ -795,7 +795,10 @@ bfd_make_section_anyway (abfd, name) section. */ newsect->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; } |