diff --git a/src/agent_map.c b/src/agent_map.c
index 144b6cbe4ee4d18b8e2aab1d67fd53bdbfdb4e65..c4a88899cc2d92e60297c0743fa8aa4c1f312520 100644
--- a/src/agent_map.c
+++ b/src/agent_map.c
@@ -1944,6 +1944,7 @@ static struct cmdu_buff *prepare_ap_metrics_query(
 					total_bss * sizeof(uint8_t));
 			if (!bsslist)
 				goto error;
+			bsslist_orig = NULL;
 
 			for (j = 0; j < radio->num_bss; j++) {
 				bss = radio->bsslist + j;
@@ -1970,6 +1971,7 @@ static struct cmdu_buff *prepare_ap_metrics_query(
 				total_bss * sizeof(uint8_t));
 		if (!bsslist)
 			goto error;
+		bsslist_orig = NULL;
 
 		for (j = 0; j < radio->num_bss; j++) {
 			bss = radio->bsslist + j;