Don't allocate more space than necessary for a sip_pkt

This extra allocation is a hold-over from when pkt->data was a 
character array. Now that it is an allocated string, just allocate 
enough for the sip_pkt.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.2@314549 65c4cc65-6c06-0410-ace0-fbb531ad65f3
1.6.2
Terry Wilson 14 years ago
parent 0dc9bdf3ec
commit dd044c85d7

@ -3938,7 +3938,7 @@ static enum sip_result __sip_reliable_xmit(struct sip_pvt *p, int seqno, int res
}
}
if (!(pkt = ast_calloc(1, sizeof(*pkt) + len + 1)))
if (!(pkt = ast_calloc(1, sizeof(*pkt))))
return AST_FAILURE;
/* copy data, add a terminator and save length */
if (!(pkt->data = ast_str_create(len))) {

Loading…
Cancel
Save