summaryrefslogtreecommitdiffstats
path: root/libdwfl/link_map.c
diff options
context:
space:
mode:
authorMark Wielaard <[email protected]>2013-06-05 17:03:25 +0200
committerMark Wielaard <[email protected]>2013-06-05 22:52:39 +0200
commit24b26ec1aaf4dc87d274f1786a1ad83b3ec2ba25 (patch)
tree2cab316e5bb18778ee8ed0b762ba3cff803f4643 /libdwfl/link_map.c
parent8ff862960efb648cdff647d7fad1be5acffe9b11 (diff)
libdwfl: link_map.c (report_r_debug) always release memory_callback buffer.
If the buffer isn't released after getting a valid build-id from the memory_callback the first run-unstrip-n.sh testcase will fail on systems where there is a matching librt.so file for which dwfl_addrsegment returns a valid segment index in the Dwfl (but where the build-id doesn't match). Signed-off-by: Mark Wielaard <[email protected]>
Diffstat (limited to 'libdwfl/link_map.c')
-rw-r--r--libdwfl/link_map.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/libdwfl/link_map.c b/libdwfl/link_map.c
index e752a5db..fecf616d 100644
--- a/libdwfl/link_map.c
+++ b/libdwfl/link_map.c
@@ -395,12 +395,17 @@ report_r_debug (uint_fast8_t elfclass, uint_fast8_t elfdata,
if (! (*memory_callback) (dwfl, segndx,
&buffer, &buffer_available,
build_id_vaddr, build_id_len,
- memory_callback_arg)
- || memcmp (build_id_bits, buffer, build_id_len) != 0)
+ memory_callback_arg))
+ /* File has valid build-id which cannot be verified
+ in memory. */
+ valid = false;
+ else
{
- /* File has valid build-id which cannot be verified
- in memory. */
- valid = false;
+ if (memcmp (build_id_bits, buffer, build_id_len) != 0)
+ /* File has valid build-id which does not match
+ the one in memory. */
+ valid = false;
+ release_buffer (0);
}
}