diff --git a/res/res_pjsip.c b/res/res_pjsip.c
index 82d06dc629d41a83fbd40e8c4f291b3e1f423185..347c579912e5563609e2cce7d7ef39fdb8eda3f8 100644
--- a/res/res_pjsip.c
+++ b/res/res_pjsip.c
@@ -3551,6 +3551,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;
 	}
 
diff --git a/res/res_pjsip_mwi.c b/res/res_pjsip_mwi.c
index 925556ed48d17ec1578e9f96506adc956a167b48..e625df77a723aaf0c208269c9cfa68eaf5bbdda7 100644
--- a/res/res_pjsip_mwi.c
+++ b/res/res_pjsip_mwi.c
@@ -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;
 	}