From 9684b2a63aa039729c39cedf40a19c9c74518edb Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Wed, 26 Aug 2020 11:10:25 +0200 Subject: [PATCH] uhd: fix memleak when USRP wasn't found --- lib/src/phy/rf/rf_uhd_imp.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/phy/rf/rf_uhd_imp.cc b/lib/src/phy/rf/rf_uhd_imp.cc index 7ba8c2cd8..8851f48e3 100644 --- a/lib/src/phy/rf/rf_uhd_imp.cc +++ b/lib/src/phy/rf/rf_uhd_imp.cc @@ -702,6 +702,7 @@ int rf_uhd_open_multi(char* args, void** h, uint32_t nof_channels) // Make USRP if (handler->uhd->usrp_make(device_addr, nof_channels) != UHD_ERROR_NONE) { print_usrp_error(handler); + uhd_free(handler); return SRSLTE_ERROR; } @@ -829,7 +830,6 @@ int rf_uhd_open_multi(char* args, void** h, uint32_t nof_channels) int rf_uhd_close(void* h) { - // Makes sure Tx is ended void* buff[SRSLTE_MAX_CHANNELS] = {}; rf_uhd_send_timed_multi(h, buff, 0, 0, 0, false, true, false, true);