summaryrefslogtreecommitdiff
path: root/channels/chan_sip.c
diff options
context:
space:
mode:
Diffstat (limited to 'channels/chan_sip.c')
-rw-r--r--channels/chan_sip.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 6c2ff43fd..367aeee8e 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -5657,7 +5657,7 @@ static int create_addr_from_peer(struct sip_pvt *dialog, struct sip_peer *peer)
/* Change the dialog callid. */
callid_size = strlen(tmpcall) + strlen(peer->fromdomain) + 2;
- new_callid = alloca(callid_size);
+ new_callid = ast_alloca(callid_size);
snprintf(new_callid, callid_size, "%s@%s", tmpcall, peer->fromdomain);
change_callid_pvt(dialog, new_callid);
}
@@ -13829,7 +13829,7 @@ static void state_notify_build_xml(struct state_notify_data *data, int full, con
cid_num = S_COR(ast_channel_caller(caller)->id.number.valid,
ast_channel_caller(caller)->id.number.str, "");
need = strlen(cid_num) + strlen(p->fromdomain) + sizeof("sip:@");
- remote_target = alloca(need);
+ remote_target = ast_alloca(need);
snprintf(remote_target, need, "sip:%s@%s", cid_num, p->fromdomain);
remote_display = ast_strdupa(S_COR(ast_channel_caller(caller)->id.name.valid,
@@ -13838,7 +13838,7 @@ static void state_notify_build_xml(struct state_notify_data *data, int full, con
connected_num = S_COR(ast_channel_connected(caller)->id.number.valid,
ast_channel_connected(caller)->id.number.str, "");
need = strlen(connected_num) + strlen(p->fromdomain) + sizeof("sip:@");
- local_target = alloca(need);
+ local_target = ast_alloca(need);
snprintf(local_target, need, "sip:%s@%s", connected_num, p->fromdomain);
local_display = ast_strdupa(S_COR(ast_channel_connected(caller)->id.name.valid,
@@ -25025,7 +25025,8 @@ static int local_attended_transfer(struct sip_pvt *transferer, struct sip_dual *
payload_size = ast_connected_line_build_data(connected_line_data,
sizeof(connected_line_data), &connected_to_target, NULL);
frame_size = payload_size + sizeof(*frame_payload);
- if (payload_size != -1 && (frame_payload = alloca(frame_size))) {
+ if (payload_size != -1) {
+ frame_payload = ast_alloca(frame_size);
frame_payload->payload_size = payload_size;
memcpy(frame_payload->payload, connected_line_data, payload_size);
frame_payload->action = AST_FRAME_READ_ACTION_CONNECTED_LINE_MACRO;
@@ -27037,7 +27038,7 @@ static int handle_incoming(struct sip_pvt *p, struct sip_request *req, struct as
int data_size = sizeof(*cause_code);
/* size of the string making up the cause code is "SIP " + cause length */
data_size += 4 + strlen(REQ_OFFSET_TO_STR(req, rlpart2));
- cause_code = alloca(data_size);
+ cause_code = ast_alloca(data_size);
ast_copy_string(cause_code->chan_name, ast_channel_name(p->owner), AST_CHANNEL_NAME);
@@ -31734,7 +31735,7 @@ static int sip_addheader(struct ast_channel *chan, const char *data)
}
if (ok) {
size_t len = strlen(inbuf);
- subbuf = alloca(len + 1);
+ subbuf = ast_alloca(len + 1);
ast_get_encoded_str(inbuf, subbuf, len + 1);
pbx_builtin_setvar_helper(chan, varbuf, subbuf);
if (sipdebug) {