From 44b1748a8752b61036333c39e83dcaa6239259aa Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Thu, 8 Mar 2018 17:56:52 +0100 Subject: [PATCH] fix mem leak in sync --- lib/src/phy/sync/sync.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/lib/src/phy/sync/sync.c b/lib/src/phy/sync/sync.c index c948a53d4..39bd98141 100644 --- a/lib/src/phy/sync/sync.c +++ b/lib/src/phy/sync/sync.c @@ -152,21 +152,19 @@ clean_exit: void srslte_sync_free(srslte_sync_t *q) { if (q) { - srslte_pss_free(&q->pss); srslte_sss_free(&q->sss); srslte_cfo_free(&q->cfo_corr_frame); srslte_cfo_free(&q->cfo_corr_symbol); srslte_cp_synch_free(&q->cp_synch); - if (q->cfo_i_initiated) { - for (int i=0;i<2;i++) { - if (q->cfo_i_corr[i]) { - free(q->cfo_i_corr[i]); - } - srslte_pss_free(&q->pss_i[i]); + for (int i = 0; i < 2; i++) { + if (q->cfo_i_corr[i]) { + free(q->cfo_i_corr[i]); } + srslte_pss_free(&q->pss_i[i]); } + if (q->temp) { free(q->temp); }