Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 3cef6bbf authored by George Burgess IV's avatar George Burgess IV
Browse files

amrnb: Fix memory leaks

This fixes two independent memory leaks.

The one in sp_dec also replaces apparently broken (and dynamically dead)
code. Decoder_amr_init and Post_Process_reset can apparently only fail
if you pass them null pointers. In any case, `GSMDecodeFrameExit(s)`
basically does `free(*s)` if `(s != NULL && *s != NULL)`; as written,
we'll free the first *member* of `tmp` in the old block here, and leave
the original allocation unfreed.

Reported by the static analyzer:

frameworks/av/media/libstagefright/codecs/amrnb/common/src/lsp.cpp:185:17:
warning: Potential leak of memory pointed to by 's'
[clang-analyzer-unix.Malloc]
frameworks/av/media/libstagefright/codecs/amrnb/dec/src/sp_dec.cpp:278:9:
warning: Potential leak of memory pointed to by 'tempVoid'
[clang-analyzer-unix.Malloc]

Bug: None
Test: Built again with the analyzer
Change-Id: Idcbd8fb98259693df5ecce14583367b98c9fe1d7
parent 5e195df5
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment