[svn-commits] kpfleming: branch 1.4 r45621 - /branches/1.4/channels/chan_sip.c

svn-commits at lists.digium.com svn-commits at lists.digium.com
Wed Oct 18 16:49:39 MST 2006


Author: kpfleming
Date: Wed Oct 18 18:49:39 2006
New Revision: 45621

URL: http://svn.digium.com/view/asterisk?rev=45621&view=rev
Log:
don't leak memory when a chan_sip thread is destroyed that has a thread-local temp_pvt allocated

Modified:
    branches/1.4/channels/chan_sip.c

Modified: branches/1.4/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/channels/chan_sip.c?rev=45621&r1=45620&r2=45621&view=diff
==============================================================================
--- branches/1.4/channels/chan_sip.c (original)
+++ branches/1.4/channels/chan_sip.c Wed Oct 18 18:49:39 2006
@@ -1146,8 +1146,10 @@
 	int recheck;
 } regl;
 
+static void temp_pvt_cleanup(void *);
+
 /*! \brief A per-thread temporary pvt structure */
-AST_THREADSTORAGE(ts_temp_pvt, temp_pvt_init);
+AST_THREADSTORAGE_CUSTOM(ts_temp_pvt, temp_pvt_init, temp_pvt_cleanup);
 
 /*! \todo Move the sip_auth list to AST_LIST */
 static struct sip_auth *authl = NULL;		/*!< Authentication list for realm authentication */
@@ -5560,6 +5562,13 @@
 		add_header(&resp, "X-Asterisk-HangupCauseCode", buf);
 	}
 	return send_response(p, &resp, reliable, seqno);
+}
+
+static void temp_pvt_cleanup(void *data)
+{
+	struct sip_pvt *p = data;
+
+	ast_string_field_free_pools(p);
 }
 
 /*! \brief Transmit response, no retransmits, using a temporary pvt structure */



More information about the svn-commits mailing list