mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
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
This commit is contained in:
committed by
Scott Griepentrog
parent
d1495bc0eb
commit
1ea7a5a774
@@ -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;
|
||||
|
Reference in New Issue
Block a user