[lttng-dev] [PATCH lttng-ust] Fix: potential leaks in error paths

Antoine Busque abusque at efficios.com
Tue Sep 8 17:33:18 EDT 2015


Signed-off-by: Antoine Busque <abusque at efficios.com>
---
 liblttng-ust/lttng-ust-elf.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/liblttng-ust/lttng-ust-elf.c b/liblttng-ust/lttng-ust-elf.c
index ce58539..4de380c 100644
--- a/liblttng-ust/lttng-ust-elf.c
+++ b/liblttng-ust/lttng-ust-elf.c
@@ -545,6 +545,7 @@ int lttng_ust_elf_get_build_id(struct lttng_ust_elf *elf, uint8_t **build_id,
 	*found = _found;
 	return 0;
 error:
+	free(_build_id);
 	return -1;
 }
 
@@ -681,5 +682,6 @@ int lttng_ust_elf_get_debug_link(struct lttng_ust_elf *elf, char **filename,
 	*found = _found;
 	return 0;
 error:
+	free(_filename);
 	return -1;
 }
-- 
2.5.1




More information about the lttng-dev mailing list