diff options
author | Scott Griepentrog <scott@griepentrog.com> | 2016-03-02 11:17:54 -0600 |
---|---|---|
committer | Scott Griepentrog <sgriepentrog@digium.com> | 2016-03-02 12:00:37 -0600 |
commit | 1ea7a5a774ee7c70325e1be37afb403dac1abbc3 (patch) | |
tree | 167f6ca70ff2cca6511b9ac6d1ddc095da6e0e0c /res | |
parent | d1495bc0ebed86d322488bed647b43aba0ae9b1f (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')
-rw-r--r-- | res/res_pjsip_messaging.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/res/res_pjsip_messaging.c b/res/res_pjsip_messaging.c index 54880dba9..f7d2e0a67 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; |