summaryrefslogtreecommitdiffstats
path: root/src/host
diff options
context:
space:
mode:
Diffstat (limited to 'src/host')
-rw-r--r--src/host/layer23/src/transceiver/demod.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/host/layer23/src/transceiver/demod.c b/src/host/layer23/src/transceiver/demod.c
index 45b0570a..98a76c6b 100644
--- a/src/host/layer23/src/transceiver/demod.c
+++ b/src/host/layer23/src/transceiver/demod.c
@@ -21,8 +21,10 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include <errno.h>
#include <stdio.h>
#include <stdint.h>
+#include <stdlib.h>
#include <string.h>
#include <osmocom/dsp/cxvec.h>
@@ -69,8 +71,10 @@ gsm_ab_ind_process(struct app_state *as,
/* Demodulate */
bits = gsm_ab_demodulate(as->gs, burst, chan, toa);
- if (!bits)
+ if (!bits) {
+ rv = -ENOMEM;
goto err;
+ }
/* Copy */
memset(data, 0x00, 148);
@@ -83,8 +87,12 @@ gsm_ab_ind_process(struct app_state *as,
*toa_p = toa;
- return 0;
+ rv = 0;
+ /* Cleanup */
err:
- return -1;
+ free(bits);
+ osmo_cxvec_free(burst);
+
+ return rv;
}