From 752bc265369dfef7e1a782e20d578b600b43749e Mon Sep 17 00:00:00 2001 From: Uwe Bonnes Date: Sun, 29 Nov 2020 19:58:44 +0100 Subject: [PATCH] adiv5: Fix memleak with duplicated base. --- src/target/adiv5.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/target/adiv5.c b/src/target/adiv5.c index 8ab2a25..8c5e714 100644 --- a/src/target/adiv5.c +++ b/src/target/adiv5.c @@ -670,7 +670,6 @@ void adiv5_dp_init(ADIv5_DP_t *dp) return; } } - /* This AP reset logic is described in ADIv5, but fails to work * correctly on STM32. CDBGRSTACK is never asserted, and we * just wait forever. This scenario is described in B2.4.1 @@ -736,6 +735,7 @@ void adiv5_dp_init(ADIv5_DP_t *dp) dp->ap_cleanup(i); #endif adiv5_ap_unref(ap); + adiv5_dp_unref(dp); /* FIXME: Should we expect valid APs behind duplicate ones? */ return; }