diff options
author | Nick Clifton <nickc@redhat.com> | 2003-03-31 18:13:25 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2003-03-31 18:13:25 +0000 |
commit | 5ed6aba41c826194dcc97807392b22a3cefa1d7e (patch) | |
tree | 8e87d13436f477ba70e90e9109c69dcaf3d18e27 /bfd/simple.c | |
parent | ee42cf8cc569b0ad926df63483075ccd868a10fa (diff) | |
download | gdb-5ed6aba41c826194dcc97807392b22a3cefa1d7e.zip gdb-5ed6aba41c826194dcc97807392b22a3cefa1d7e.tar.gz gdb-5ed6aba41c826194dcc97807392b22a3cefa1d7e.tar.bz2 |
Fix memory leaks
Diffstat (limited to 'bfd/simple.c')
-rw-r--r-- | bfd/simple.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/bfd/simple.c b/bfd/simple.c index 88f1337..30f9be0 100644 --- a/bfd/simple.c +++ b/bfd/simple.c @@ -1,5 +1,5 @@ /* simple.c -- BFD simple client routines - Copyright 2002 + Copyright 2002, 2003 Free Software Foundation, Inc. Contributed by MontaVista Software, Inc. @@ -135,7 +135,7 @@ bfd_simple_get_relocated_section_contents (abfd, sec, outbuf) struct bfd_link_order link_order; struct bfd_link_callbacks callbacks; bfd_byte *contents, *data; - int storage_needed, number_of_symbols; + int storage_needed; asymbol **symbol_table; if (! (sec->flags & SEC_RELOC)) @@ -187,7 +187,7 @@ bfd_simple_get_relocated_section_contents (abfd, sec, outbuf) storage_needed = bfd_get_symtab_upper_bound (abfd); symbol_table = (asymbol **) bfd_malloc (storage_needed); - number_of_symbols = bfd_canonicalize_symtab (abfd, symbol_table); + bfd_canonicalize_symtab (abfd, symbol_table); contents = bfd_get_relocated_section_contents (abfd, &link_info, @@ -208,5 +208,6 @@ bfd_simple_get_relocated_section_contents (abfd, sec, outbuf) bfd_link_hash_table_free (abfd, link_info.hash); + free (symbol_table); return contents; } |