From: Terry Wilson Date: Thu, 21 Apr 2011 00:17:34 +0000 (+0000) Subject: Don't allocate more space than necessary for a sip_pkt X-Git-Tag: 1.6.2.19-rc1~3^2~55 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dd044c85d7d833960861b701455dfd9010f1f507;p=thirdparty%2Fasterisk.git 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 --- diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 19039c68eb..fdf1ffcfd5 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -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))) {