[Asterisk-code-review] Revert "res_rtp_asterisk: Free payload when error on insertion to dat... (asterisk[certified/16.8])
Joshua Colp
asteriskteam at digium.com
Wed Apr 22 13:43:43 CDT 2020
Joshua Colp has submitted this change. ( https://gerrit.asterisk.org/c/asterisk/+/14294 )
Change subject: Revert "res_rtp_asterisk: Free payload when error on insertion to data buffer"
......................................................................
Revert "res_rtp_asterisk: Free payload when error on insertion to data buffer"
This reverts commit fef8a04aadf759bf08f12827de18f970ae7e3e8c.
Reason for revert: Waiting for future release.
Change-Id: I67e9837a352b252f8a75ebaa9a5fb7e5b35d41f7
---
M main/data_buffer.c
M res/res_rtp_asterisk.c
2 files changed, 3 insertions(+), 7 deletions(-)
Approvals:
Joshua Colp: Looks good to me, approved; Approved for Submit
Friendly Automation: Verified
diff --git a/main/data_buffer.c b/main/data_buffer.c
index 85e7971..cfc323c 100644
--- a/main/data_buffer.c
+++ b/main/data_buffer.c
@@ -254,7 +254,7 @@
AST_LIST_TRAVERSE_SAFE_END;
if (inserted == -1) {
- return -1;
+ return 0;
}
if (!inserted) {
diff --git a/res/res_rtp_asterisk.c b/res/res_rtp_asterisk.c
index 6c4f408..a5b7106 100644
--- a/res/res_rtp_asterisk.c
+++ b/res/res_rtp_asterisk.c
@@ -4897,9 +4897,7 @@
if (payload) {
payload->size = packet_len;
memcpy(payload->buf, rtpheader, packet_len);
- if (ast_data_buffer_put(rtp->send_buffer, rtp->seqno, payload) == -1) {
- ast_free(payload);
- }
+ ast_data_buffer_put(rtp->send_buffer, rtp->seqno, payload);
}
}
@@ -7841,9 +7839,7 @@
payload->size = res;
memcpy(payload->buf, rtpheader, res);
- if (ast_data_buffer_put(rtp->recv_buffer, seqno, payload) == -1) {
- ast_free(payload);
- }
+ ast_data_buffer_put(rtp->recv_buffer, seqno, payload);
/* If this sequence number is removed that means we had a gap and this packet has filled it in
* some. Since it was part of the gap we will have already added any other missing sequence numbers
--
To view, visit https://gerrit.asterisk.org/c/asterisk/+/14294
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: certified/16.8
Gerrit-Change-Id: I67e9837a352b252f8a75ebaa9a5fb7e5b35d41f7
Gerrit-Change-Number: 14294
Gerrit-PatchSet: 2
Gerrit-Owner: Joshua Colp <jcolp at sangoma.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at sangoma.com>
Gerrit-Reviewer: nappsoft <infos at nappsoft.ch>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20200422/09535934/attachment.html>
More information about the asterisk-code-review
mailing list