summaryrefslogtreecommitdiff
path: root/res/res_pjsip_messaging.c
diff options
context:
space:
mode:
authorScott Griepentrog <scott@griepentrog.com>2016-03-02 11:17:54 -0600
committerScott Griepentrog <scott@griepentrog.com>2016-03-02 11:56:51 -0600
commit0a3f0e85ace6f55fa5826c301ccaac066d24a11f (patch)
tree43bf03394722e99973c214ef6586db05513b94c4 /res/res_pjsip_messaging.c
parentd0b26c3133e831e915990fd806257d9ef07c508b (diff)
CHAOS: cleanup possible null vars on msg alloc failure
In message.c, if msg_alloc fails to init the string field, vars may be null, so use a null tolerant cleanup. In res_pjsip_messaging.c, if msg_data_create fails, mdata will be null, so use a null tolerant cleanup. ASTERISK-25323 Change-Id: Ic2d55c2c3750d5616e2a05ea92a19c717507ff56
Diffstat (limited to 'res/res_pjsip_messaging.c')
-rw-r--r--res/res_pjsip_messaging.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/res/res_pjsip_messaging.c b/res/res_pjsip_messaging.c
index 7532e39be..9a31630e7 100644
--- a/res/res_pjsip_messaging.c
+++ b/res/res_pjsip_messaging.c
@@ -597,7 +597,7 @@ static int sip_msg_send(const struct ast_msg *msg, const char *to, const char *f
if (!(mdata = msg_data_create(msg, to, from)) ||
ast_sip_push_task(message_serializer, msg_send, mdata)) {
- ao2_ref(mdata, -1);
+ ao2_cleanup(mdata);
return -1;
}
return 0;