aboutsummaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-devtools/ltrace/ltrace/0001-ppc-plt-do-not-free-symbol-libsym.patch
blob: 4793e561c0343e8cf9559a9b501c38d32581ba4e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
From f47672bed5905ae382e80b09dafca9a8da45aa67 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Tue, 19 Apr 2022 18:44:36 -0700
Subject: [PATCH] ppc/plt: do not free symbol libsym

delete_symbol_chain() will call free as well if sybol is non-null
it also fixes use-after-free warnings that compiler emits

Upstream-Status: Submitted [https://gitlab.com/cespedes/ltrace/-/merge_requests/2]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 sysdeps/linux-gnu/ppc/plt.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/sysdeps/linux-gnu/ppc/plt.c b/sysdeps/linux-gnu/ppc/plt.c
index 5f81889..7c1c025 100644
--- a/sysdeps/linux-gnu/ppc/plt.c
+++ b/sysdeps/linux-gnu/ppc/plt.c
@@ -687,7 +687,6 @@ arch_elf_add_func_entry(struct process *proc, struct ltelf *lte,
 		if (libsym == NULL
 		    || library_symbol_init(libsym, addr, full_name, 1,
 					   LS_TOPLT_NONE) < 0) {
-			free(libsym);
 			delete_symbol_chain(libsym);
 			libsym = NULL;
 			fprintf(stderr, "Couldn't add symbol %s"
-- 
2.36.0