mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-02 19:16:15 +00:00
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
This commit is contained in:
committed by
Friendly Automation
parent
ef580f96e7
commit
ca032d1e2e
@@ -254,7 +254,7 @@ int ast_data_buffer_put(struct ast_data_buffer *buffer, size_t pos, void *payloa
|
||||
AST_LIST_TRAVERSE_SAFE_END;
|
||||
|
||||
if (inserted == -1) {
|
||||
return 0;
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!inserted) {
|
||||
|
Reference in New Issue
Block a user