From: Joshua Colp Date: Mon, 20 Nov 2006 16:16:22 +0000 (+0000) Subject: Free history items at the end of use of the temporary SIP pvt structure. (issue ... X-Git-Tag: 1.2.14~43 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fea6c62d613e3b55f8cd6ca1cc85330153de1e71;p=thirdparty%2Fasterisk.git Free history items at the end of use of the temporary SIP pvt structure. (issue #8383 reported by benh) git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@47855 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_sip.c b/channels/chan_sip.c index e90e96362c..e6ef035d55 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -4297,6 +4297,7 @@ static int __transmit_response(struct sip_pvt *p, char *msg, struct sip_request static int transmit_response_using_temp(char *callid, struct sockaddr_in *sin, int useglobal_nat, const int intended_method, struct sip_request *req, char *msg) { struct sip_pvt *p = alloca(sizeof(*p)); + struct sip_history *hist = NULL; memset(p, 0, sizeof(*p)); @@ -4322,6 +4323,11 @@ static int transmit_response_using_temp(char *callid, struct sockaddr_in *sin, i __transmit_response(p, msg, req, 0); + while ((hist = p->history)) { + p->history = p->history->next; + free(hist); + } + return 0; }