Module: sip-router
Branch: 4.0
Commit: 527db661fa3f3bc3899eaf9c264c9080cc757318
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=527db66…
Author: Peter Dunkley <peter.dunkley(a)crocodile-rcs.com>
Committer: Peter Dunkley <peter.dunkley(a)crocodile-rcs.com>
Date: Fri Mar 15 14:54:41 2013 +0000
modules/outbound: free shared memory for flow-token key during shutdown
(cherry picked from commit 9d9d51438acd1d534f14ecbc8eb0030b45333177)
---
modules/outbound/ob_mod.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/modules/outbound/ob_mod.c b/modules/outbound/ob_mod.c
index 4c4e7ea..7cf0c74 100644
--- a/modules/outbound/ob_mod.c
+++ b/modules/outbound/ob_mod.c
@@ -43,6 +43,7 @@ MODULE_VERSION
#define OB_KEY_LEN 20
static int mod_init(void);
+static void destroy(void);
static unsigned int ob_force_flag = (unsigned int) -1;
static str ob_key = {0, 0};
@@ -73,7 +74,7 @@ struct module_exports exports=
0, /* extra processes */
mod_init, /* module initialization function */
0, /* response function */
- 0, /* destroy function */
+ destroy, /* destroy function */
0 /* per-child initialization function */
};
@@ -100,6 +101,11 @@ static int mod_init(void)
return 0;
}
+static void destroy(void)
+{
+ shm_free(ob_key.s);
+}
+
/* Structure of flow-token
<HMAC-SHA1-80><protocol><dst_ip><dst_port><src_ip><src_port>