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 <[email protected]>
---
 src/elfclassify.c | 2 ++
 1 file changed, 2 insertions(+)

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;
        }
 
-- 
2.52.0

Reply via email to