summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSylvain Munaut <tnt@246tNt.com>2013-06-20 09:59:46 +0200
committerAndreas Eversberg <jolly@eversberg.eu>2013-10-05 19:44:39 +0200
commit45431603cbebe21b825a5ad1479e8462d8b5ebf0 (patch)
tree633962368b7c6796d0cba257139175a04d2b92d2
parent55d1c4d7038045c63f29056adfa0dae220c49439 (diff)
host/transceiver: Fix leak in AB processing codepath
Thanks to Andreas for pointing this out Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
-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;
}