summaryrefslogtreecommitdiffstats
path: root/src/nm.c
diff options
context:
space:
mode:
authorMark Wielaard <[email protected]>2020-06-11 00:06:30 +0200
committerMark Wielaard <[email protected]>2020-06-11 03:58:27 +0200
commit49f13584d60322578c19b6118393ab04236ca7bf (patch)
tree88c79fbf73c54734c51b6b4a9a2a154e229f30c6 /src/nm.c
parentc0d643e7d91fc002c9fecd83277c62a0e56ef76f (diff)
parent2c7c40373b68968cce20a60a28234e2a2cbc55cb (diff)
Merge tag 'elfutils-0.178' into mjw/RH-DTSdts-0.178
elfutils 0.178 release Adopt ebl backends loading from trunk.
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);