aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-10-19 01:04:18 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-10-19 01:04:18 +0000
commita3d8c1a8731691427ca0039348fdc24f09ec54fe (patch)
treeb80a627823b18be03bb11ba304af5961b9af3c32
parent21cbb8bb6832b87a3fe1dcc915c0ac69a9a7c73a (diff)
Merge fix to not leak the stringfields of a thread speicif sip_pvt. This also
includes the fix not to leak the actual sip_pvt. Merged revisions 45622 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r45622 | russell | 2006-10-18 20:59:51 -0400 (Wed, 18 Oct 2006) | 2 lines Don't leak the actual thread-specific sip_pvt struct ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@45624 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--channels/chan_sip.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 18b232587..c23f54aa3 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -1142,8 +1142,10 @@ static struct ast_register_list {
int recheck;
} regl;
+static void temp_pvt_cleanup(void *);
+
/*! \brief A per-thread temporary pvt structure */
-AST_THREADSTORAGE(ts_temp_pvt);
+AST_THREADSTORAGE_CUSTOM(ts_temp_pvt, NULL, temp_pvt_cleanup);
/*! \todo Move the sip_auth list to AST_LIST */
static struct sip_auth *authl = NULL; /*!< Authentication list for realm authentication */
@@ -5530,6 +5532,15 @@ static int __transmit_response(struct sip_pvt *p, const char *msg, const struct
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);
+
+ free(data);
+}
+
/*! \brief Transmit response, no retransmits, using a temporary pvt structure */
static int transmit_response_using_temp(ast_string_field callid, struct sockaddr_in *sin, int useglobal_nat, const int intended_method, const struct sip_request *req, const char *msg)
{