diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2017-09-25 14:07:01 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2017-09-25 14:07:01 -0700 |
commit | 8dba52b60488265e66073130ef77c03f05dcaabc (patch) | |
tree | ad3aed8b495c3d28bb2470ed392f4350dedba035 /binutils/nm.c | |
parent | 289e23aa03084b22c73ebdcf18371f1e6666ead0 (diff) | |
download | gdb-8dba52b60488265e66073130ef77c03f05dcaabc.zip gdb-8dba52b60488265e66073130ef77c03f05dcaabc.tar.gz gdb-8dba52b60488265e66073130ef77c03f05dcaabc.tar.bz2 |
Free memory returned from bfd_get_synthetic_symtab
PR binutils/22203
* nm.c (display_rel_file): Free memory returned from
bfd_get_synthetic_symtab.
Diffstat (limited to 'binutils/nm.c')
-rw-r--r-- | binutils/nm.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/binutils/nm.c b/binutils/nm.c index 5e03a8a..3328812 100644 --- a/binutils/nm.c +++ b/binutils/nm.c @@ -1094,6 +1094,7 @@ display_rel_file (bfd *abfd, bfd *archive_bfd) void *minisyms; unsigned int size; struct size_sym *symsizes; + asymbol *synthsyms = NULL; if (! dynamic) { @@ -1124,7 +1125,6 @@ display_rel_file (bfd *abfd, bfd *archive_bfd) if (show_synthetic && size == sizeof (asymbol *)) { - asymbol *synthsyms; asymbol **static_syms = NULL; asymbol **dyn_syms = NULL; long static_count = 0; @@ -1201,6 +1201,8 @@ display_rel_file (bfd *abfd, bfd *archive_bfd) else print_size_symbols (abfd, dynamic, symsizes, symcount, archive_bfd); + if (synthsyms) + free (synthsyms); free (minisyms); free (symsizes); } |