From 3308655a7e594e7d8e59146f77f18a767599538d Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Fri, 18 Mar 2022 10:58:03 -0400 Subject: [PATCH] Fix: lttng-elf: wrong error label used by error path MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 1486805 Resource leak The system resource will not be reclaimed and reused, reducing the future availability of the resource. In lttng_elf_get_symbol_offset: Leak of memory or pointers to system resources (CWE-404) Reported-by: Coverity Scan Signed-off-by: Jérémie Galarneau Change-Id: I78b868773b389c2eaf3f1d45151fe9416b1fe447 --- src/common/lttng-elf.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/lttng-elf.cpp b/src/common/lttng-elf.cpp index 711447203..23d5cb7f0 100644 --- a/src/common/lttng-elf.cpp +++ b/src/common/lttng-elf.cpp @@ -827,7 +827,7 @@ int lttng_elf_get_symbol_offset(int fd, char *symbol, uint64_t *offset) if (symtab_hdr.sh_entsize == 0) { DBG("Invalid ELF string table entry size."); ret = LTTNG_ERR_ELF_PARSING; - goto free_symbol_table_data; + goto free_string_table_data; } sym_count = symtab_hdr.sh_size / symtab_hdr.sh_entsize; -- 2.34.1