]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
res_pjsip: Fix some off nominal tdata leaks. 87/4887/1
authorRichard Mudgett <rmudgett@digium.com>
Wed, 1 Feb 2017 23:56:13 +0000 (17:56 -0600)
committerRichard Mudgett <rmudgett@digium.com>
Mon, 6 Feb 2017 16:59:59 +0000 (10:59 -0600)
Change-Id: I243a4be5e7fbfe604923764969c4ee04eee89b9d

res/res_pjsip.c
res/res_pjsip_mwi.c

index e4a9b9869af696cbe63525acc720728fe8b395a8..9375893d376638cd16fb8c565f761d2bb5370ad4 100644 (file)
@@ -3549,6 +3549,7 @@ static pj_status_t endpt_send_request(struct ast_sip_endpoint *endpoint,
 
        if (!cb && token) {
                /* Silly.  Without a callback we cannot do anything with token. */
+               pjsip_tx_data_dec_ref(tdata);
                return PJ_EINVAL;
        }
 
index fb6e6b8f635f12f24e6413d3572fc33e1e1e7ec3..5ae2af5d3169320a624186373674796cf59da029 100644 (file)
@@ -502,6 +502,7 @@ static int send_unsolicited_mwi_notify_to_contact(void *obj, void *arg, int flag
        body.subtype = MWI_SUBTYPE;
        body_text = ast_str_create(64);
        if (!body_text) {
+               pjsip_tx_data_dec_ref(tdata);
                return 0;
        }
 
@@ -517,6 +518,7 @@ static int send_unsolicited_mwi_notify_to_contact(void *obj, void *arg, int flag
        if (ast_sip_pubsub_generate_body_content(body.type, body.subtype, &body_data, &body_text)) {
                ast_log(LOG_WARNING, "Unable to generate SIP MWI NOTIFY body.\n");
                ast_free(body_text);
+               pjsip_tx_data_dec_ref(tdata);
                return 0;
        }