From 4fc29490955c3f71b8c1338cb4a53d9b4cee38be Mon Sep 17 00:00:00 2001 From: Jorge Matricali Date: Thu, 15 Aug 2024 22:31:43 -0300 Subject: [PATCH] fix: Memory leak in target.c --- src/target.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/target.c b/src/target.c index 1b5b002..019941a 100644 --- a/src/target.c +++ b/src/target.c @@ -212,6 +212,7 @@ void btkg_target_list_append_range(btkg_target_list_t *target_list, } target->port = port; btkg_target_list_append(target_list, target); + free(target); return; } @@ -236,6 +237,7 @@ void btkg_target_list_append_range(btkg_target_list_t *target_list, } new_target->port = port; btkg_target_list_append(target_list, new_target); + free(new_target); } }