]> git.ipfire.org Git - thirdparty/asterisk.git/commit
res_rtp_asterisk: Free payload when error on insertion to data buffer
authorPirmin Walthert <infos@nappsoft.ch>
Tue, 14 Apr 2020 15:31:15 +0000 (17:31 +0200)
committerJoshua Colp <jcolp@sangoma.com>
Wed, 15 Apr 2020 09:46:09 +0000 (04:46 -0500)
commitfef8a04aadf759bf08f12827de18f970ae7e3e8c
treebb9c52249a63c996465786358b6d020859ed7ce6
parent81d34554abc050305ffbbf046358deb70f64bd56
res_rtp_asterisk: Free payload when error on insertion to data buffer

When the ast_data_buffer_put rejects to add a packet, for example because
the buffer already contains a packet with the same sequence number, the
payload will never be freed, resulting in a memory leak.

The data buffer will now return an error if this situation occurs
allowing the caller to free the payload. The res_rtp_asterisk module
has also been updated to do this.

ASTERISK-28826

Change-Id: Ie6c49495d1c921d5f997651c7d0f79646f095cf1
main/data_buffer.c
res/res_rtp_asterisk.c