aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjpeeler <jpeeler@f38db490-d61c-443f-a65b-d21fe96a405b>2009-08-17 16:34:56 +0000
committerjpeeler <jpeeler@f38db490-d61c-443f-a65b-d21fe96a405b>2009-08-17 16:34:56 +0000
commit0b3b3585c0551852e8c69557a3af632e7f59f679 (patch)
tree57166d4e81cedf11d26fbde8ed33c0aed03e552e
parent846c6e9c1c7c0c0e78dfb4b9340a0d1d791b834a (diff)
Fix segfault when reloading chan_misdn.
If more ports were specified than configured in misdn.conf a reload would crash asterisk. The problem was the unconfigured port was using data from the previously configured port. When the data for an unconfigured port was freed a crash would result from the double free. (closes issue #12113) Reported by: agupta Patches: bug12113.patch uploaded by jpeeler (license 325) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@212498 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--channels/misdn_config.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/channels/misdn_config.c b/channels/misdn_config.c
index 1cbd19021..9d947f726 100644
--- a/channels/misdn_config.c
+++ b/channels/misdn_config.c
@@ -1001,6 +1001,11 @@ static void _build_port_config (struct ast_variable *v, char *cat)
}
for (i = 0; i < (max_ports + 1); ++i) {
+ if (i > 0 && cfg_for_ports[0]) {
+ /* default category, will populate the port_cfg with additional port
+ categories in subsequent calls to this function */
+ memset(cfg_tmp, 0, sizeof(cfg_tmp));
+ }
if (cfg_for_ports[i]) {
memcpy(port_cfg[i], cfg_tmp, sizeof(cfg_tmp));
}