summaryrefslogtreecommitdiffstats
path: root/src/nm.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nm.c')
-rw-r--r--src/nm.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/nm.c b/src/nm.c
index da1350b4..7f6cf2a2 100644
--- a/src/nm.c
+++ b/src/nm.c
@@ -1438,6 +1438,7 @@ show_symbols (int fd, Ebl *ebl, GElf_Ehdr *ehdr,
free (demangle_buffer);
#endif
/* Now we know the exact number. */
+ size_t nentries_orig = nentries;
nentries = nentries_used;
/* Sort the entries according to the users wishes. */
@@ -1472,7 +1473,7 @@ show_symbols (int fd, Ebl *ebl, GElf_Ehdr *ehdr,
}
/* Free all memory. */
- if (nentries * sizeof (sym_mem[0]) >= MAX_STACK_ALLOC)
+ if (nentries_orig * sizeof (sym_mem[0]) >= MAX_STACK_ALLOC)
free (sym_mem);
obstack_free (&whereob, NULL);