summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2017-09-09 13:48:38 +0300
committerVadim Yanitskiy <axilirator@gmail.com>2017-12-31 12:20:59 +0100
commit14637746d3f5a45fba4987d9892c50ca07434fd6 (patch)
tree0b78844b49ec9d49e7b2b0a138c6a8255ebf480d
parent3c20dac38c774afe2dfb769451a1d987c21f9c65 (diff)
libosmogapk: fix memory leak in both AMR and EFR codecs
The memory, allocated by codec_efr_init() / codec_amr_init(), was not cleaned after calling the codec_exit(). Found using talloc memory debugging API.
-rw-r--r--src/codec_amr.c2
-rw-r--r--src/codec_efr.c2
2 files changed, 4 insertions, 0 deletions
diff --git a/src/codec_amr.c b/src/codec_amr.c
index df35b49..a2787d7 100644
--- a/src/codec_amr.c
+++ b/src/codec_amr.c
@@ -61,6 +61,8 @@ codec_amr_exit(void *state)
Decoder_Interface_exit(st->decoder);
Encoder_Interface_exit(st->encoder);
+ talloc_free(st);
+
return;
}
diff --git a/src/codec_efr.c b/src/codec_efr.c
index 98bfdcd..ddd3790 100644
--- a/src/codec_efr.c
+++ b/src/codec_efr.c
@@ -62,6 +62,8 @@ codec_efr_exit(void *state)
Decoder_Interface_exit(st->decoder);
Encoder_Interface_exit(st->encoder);
+ talloc_free(st);
+
return;
}