From: Aaron Merey Date: Tue, 3 Feb 2026 21:31:00 +0000 (-0500) Subject: src/elfclassify.c: Fix memory leak in check_ar_members X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9129bee55721eafa54565ebfa23f7fee3df75e93;p=thirdparty%2Felfutils.git src/elfclassify.c: Fix memory leak in check_ar_members If current_path needs to be reallocated, full_path is assigned a newly malloced buffer and then full_path is assigned to current_path. This leaks the previous value of full_path. Free full_path before reassigning it. Signed-off-by: Aaron Merey --- diff --git a/src/elfclassify.c b/src/elfclassify.c index 307771b2..80a376a4 100644 --- a/src/elfclassify.c +++ b/src/elfclassify.c @@ -866,6 +866,8 @@ check_ar_members (void) bad_ar = true; break; } + + free (full_path); full_path = new_path; }