summaryrefslogtreecommitdiff
path: root/plugins/readelf
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2019-02-05 22:03:38 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2019-02-05 22:03:38 (GMT)
commit17f591f2230ac66394467d5e5eefe71cb259637d (patch)
tree1664e994b2904e5e9009027fc57749a11667365b /plugins/readelf
parentff187d24b7441e88e1f0361d59b0f6f55851791f (diff)
Fixed a huge number of memory leaks.
Diffstat (limited to 'plugins/readelf')
-rw-r--r--plugins/readelf/strtab.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/plugins/readelf/strtab.c b/plugins/readelf/strtab.c
index 7645dec..277d391 100644
--- a/plugins/readelf/strtab.c
+++ b/plugins/readelf/strtab.c
@@ -106,6 +106,12 @@ static void parse_elf_string_table(GElfFormat *format, GPreloadInfo *info, const
g_raw_instruction_mark_as_string(G_RAW_INSTRUCTION(instr), true);
+ /**
+ * Comme g_preload_info_add_instruction() peut consommer l'instruction
+ * et qu'on réutilise cette dernière ensuite avec g_arch_instruction_get_range()...
+ */
+ g_object_ref(G_OBJECT(instr));
+
inserted = g_preload_info_add_instruction(info, instr);
if (inserted)
@@ -127,6 +133,8 @@ static void parse_elf_string_table(GElfFormat *format, GPreloadInfo *info, const
}
+ g_object_unref(G_OBJECT(instr));
+
/* Conclusion */
cut = (data[end - 1] == '\0');