Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
96aac322
提交
96aac322
authored
8月 18, 2019
作者:
Andrey Volk
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-12010: [mod_sofia, mod_valet_parking, mod_enum] Fix memory leaks on FreeSWITCH shutdown.
上级
b6b3d785
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
19 行增加
和
7 行删除
+19
-7
mod_enum.c
src/mod/applications/mod_enum/mod_enum.c
+12
-7
mod_valet_parking.c
src/mod/applications/mod_valet_parking/mod_valet_parking.c
+1
-0
mod_sofia.c
src/mod/endpoints/mod_sofia/mod_sofia.c
+6
-0
没有找到文件。
src/mod/applications/mod_enum/mod_enum.c
浏览文件 @
96aac322
...
...
@@ -75,6 +75,9 @@ static struct {
int
retries
;
int
random
;
char
*
nameserver
[
ENUM_MAXNAMESERVERS
];
#ifdef _MSC_VER
char
*
nameserver_buf
;
#endif
}
globals
;
SWITCH_DECLARE_GLOBAL_STRING_FUNC
(
set_global_root
,
globals
.
root
);
...
...
@@ -164,7 +167,6 @@ static switch_status_t load_config(void)
if
(
!
globals
.
nameserver
[
0
])
{
HKEY
hKey
;
DWORD
data_sz
;
char
*
buf
;
RegOpenKeyEx
(
HKEY_LOCAL_MACHINE
,
"SYSTEM
\\
CurrentControlSet
\\
Services
\\
Tcpip
\\
Parameters"
,
0
,
KEY_QUERY_VALUE
,
&
hKey
);
...
...
@@ -172,15 +174,15 @@ static switch_status_t load_config(void)
if
(
hKey
)
{
RegQueryValueEx
(
hKey
,
"DhcpNameServer"
,
NULL
,
NULL
,
NULL
,
&
data_sz
);
if
(
data_sz
)
{
buf
=
(
char
*
)
malloc
(
data_sz
+
1
);
globals
.
nameserver_
buf
=
(
char
*
)
malloc
(
data_sz
+
1
);
RegQueryValueEx
(
hKey
,
"DhcpNameServer"
,
NULL
,
NULL
,
(
LPBYTE
)
buf
,
&
data_sz
);
RegQueryValueEx
(
hKey
,
"DhcpNameServer"
,
NULL
,
NULL
,
(
LPBYTE
)
globals
.
nameserver_
buf
,
&
data_sz
);
if
(
buf
[
data_sz
-
1
]
!=
0
)
{
buf
[
data_sz
]
=
0
;
if
(
globals
.
nameserver_
buf
[
data_sz
-
1
]
!=
0
)
{
globals
.
nameserver_
buf
[
data_sz
]
=
0
;
}
switch_replace_char
(
buf
,
' '
,
0
,
SWITCH_FALSE
);
/* only use the first entry ex "192.168.1.1 192.168.1.2" */
globals
.
nameserver
[
0
]
=
buf
;
switch_replace_char
(
globals
.
nameserver_
buf
,
' '
,
0
,
SWITCH_FALSE
);
/* only use the first entry ex "192.168.1.1 192.168.1.2" */
globals
.
nameserver
[
0
]
=
globals
.
nameserver_
buf
;
}
RegCloseKey
(
hKey
);
...
...
@@ -924,6 +926,9 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_enum_shutdown)
switch_safe_free
(
globals
.
root
);
switch_safe_free
(
globals
.
isn_root
);
#ifdef _MSC_VER
switch_safe_free
(
globals
.
nameserver_buf
);
#endif
return
SWITCH_STATUS_UNLOAD
;
}
...
...
src/mod/applications/mod_valet_parking/mod_valet_parking.c
浏览文件 @
96aac322
...
...
@@ -933,6 +933,7 @@ static void pres_event_handler(switch_event_t *event)
SWITCH_MODULE_SHUTDOWN_FUNCTION
(
mod_valet_parking_shutdown
)
{
switch_event_unbind_callback
(
pres_event_handler
);
switch_core_hash_destroy
(
&
globals
.
hash
);
return
SWITCH_STATUS_SUCCESS
;
}
...
...
src/mod/endpoints/mod_sofia/mod_sofia.c
浏览文件 @
96aac322
...
...
@@ -6473,6 +6473,12 @@ void mod_sofia_shutdown_cleanup() {
su_deinit
();
/*
Release the clone of the default SIP parser
created by `sip_update_default_mclass(sip_extend_mclass(NULL))` call with NULL argument
*/
free
(
sip_default_mclass
());
switch_mutex_lock
(
mod_sofia_globals
.
hash_mutex
);
switch_core_hash_destroy
(
&
mod_sofia_globals
.
profile_hash
);
switch_core_hash_destroy
(
&
mod_sofia_globals
.
gateway_hash
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论