]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Revert "res_rtp_asterisk: Free payload when error on insertion to data buffer"
authorJoshua Colp <jcolp@sangoma.com>
Mon, 20 Apr 2020 16:14:57 +0000 (11:14 -0500)
committerJoshua Colp <jcolp@sangoma.com>
Wed, 22 Apr 2020 18:43:41 +0000 (13:43 -0500)
This reverts commit fef8a04aadf759bf08f12827de18f970ae7e3e8c.

Reason for revert: Waiting for future release.

Change-Id: I67e9837a352b252f8a75ebaa9a5fb7e5b35d41f7

main/data_buffer.c
res/res_rtp_asterisk.c

index 85e79711c4a69389eb3d712e628650e89de64452..cfc323c680d5ac8d5266501e952471aced937c4b 100644 (file)
@@ -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 -1;
+               return 0;
        }
 
        if (!inserted) {
index 6c4f408025df11f4a87858e21bae6bacc039b0ae..a5b7106345ed1da28914d74bd2cf3f8ebfa4c730 100644 (file)
@@ -4897,9 +4897,7 @@ static int rtp_raw_write(struct ast_rtp_instance *instance, struct ast_frame *fr
                        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 @@ static struct ast_frame *ast_rtp_read(struct ast_rtp_instance *instance, int rtc
 
                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