[commit] r9184 - in freeswitch/trunk: . src/mod/say/mod_say_de src/mod/say/mod_say_en src/mod/say/mod_say_es src/mod/say/mod_say_fr src/mod/say/mod_say_it src/mod/say/mod_say_nl src/mod/say/mod_say_zh
Author: mikej Date: Mon Jul 28 12:13:52 2008 New Revision: 9184 Modified: freeswitch/trunk/Freeswitch.2008.sln freeswitch/trunk/src/mod/say/mod_say_de/mod_say_de.c freeswitch/trunk/src/mod/say/mod_say_en/mod_say_en.c freeswitch/trunk/src/mod/say/mod_say_es/mod_say_es.c freeswitch/trunk/src/mod/say/mod_say_fr/mod_say_fr.c freeswitch/trunk/src/mod/say/mod_say_it/mod_say_it.c freeswitch/trunk/src/mod/say/mod_say_nl/mod_say_nl.c freeswitch/trunk/src/mod/say/mod_say_zh/ (props changed) freeswitch/trunk/src/mod/say/mod_say_zh/mod_say_zh.2008.vcproj freeswitch/trunk/src/mod/say/mod_say_zh/mod_say_zh.c Log: fix leak when call hangs up or other error condition while saying an ip address (add mod_say_zh to windows build) Modified: freeswitch/trunk/Freeswitch.2008.sln ============================================================================== --- freeswitch/trunk/Freeswitch.2008.sln (original) +++ freeswitch/trunk/Freeswitch.2008.sln Mon Jul 28 12:13:52 2008 @@ -961,6 +961,11 @@ {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} EndProjectSection EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_say_zh", "src\mod\say\mod_say_zh\mod_say_zh.2008.vcproj", "{B6A9FB7A-1CC4-442B-812D-EC33E4E4A36E}" + ProjectSection(ProjectDependencies) = postProject + {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -1662,6 +1667,12 @@ {2A3D00C6-588D-4E86-81AC-9EF5EDE86E03}.Release|Win32.ActiveCfg = Release|Win32 {2A3D00C6-588D-4E86-81AC-9EF5EDE86E03}.Release|Win32.Build.0 = Release|Win32 {2A3D00C6-588D-4E86-81AC-9EF5EDE86E03}.Release|x64.ActiveCfg = Release|Win32 + {B6A9FB7A-1CC4-442B-812D-EC33E4E4A36E}.Debug|Win32.ActiveCfg = Debug|Win32 + {B6A9FB7A-1CC4-442B-812D-EC33E4E4A36E}.Debug|Win32.Build.0 = Debug|Win32 + {B6A9FB7A-1CC4-442B-812D-EC33E4E4A36E}.Debug|x64.ActiveCfg = Debug|Win32 + {B6A9FB7A-1CC4-442B-812D-EC33E4E4A36E}.Release|Win32.ActiveCfg = Release|Win32 + {B6A9FB7A-1CC4-442B-812D-EC33E4E4A36E}.Release|Win32.Build.0 = Release|Win32 + {B6A9FB7A-1CC4-442B-812D-EC33E4E4A36E}.Release|x64.ActiveCfg = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -1771,6 +1782,7 @@ {06E3A538-AB32-44F2-B477-755FF9CB5D37} = {6CD61A1D-797C-470A-BE08-8C31B68BB336} {6D1BEC70-4DCD-4FE9-ADBD-4A43A67E4D05} = {6CD61A1D-797C-470A-BE08-8C31B68BB336} {A4B122CF-5196-476B-8C0E-D8BD59AC3C14} = {6CD61A1D-797C-470A-BE08-8C31B68BB336} + {B6A9FB7A-1CC4-442B-812D-EC33E4E4A36E} = {6CD61A1D-797C-470A-BE08-8C31B68BB336} {3B08FEFD-4D3D-4C16-BA94-EE83509E32A0} = {57D119DC-484F-420F-B9E9-8589FD9A8DF8} {7BFD517E-7F8F-4A40-A78E-8D3632738227} = {57D119DC-484F-420F-B9E9-8589FD9A8DF8} {6374D55C-FABE-4A02-9CF1-4145308A56C5} = {57D119DC-484F-420F-B9E9-8589FD9A8DF8} Modified: freeswitch/trunk/src/mod/say/mod_say_de/mod_say_de.c ============================================================================== --- freeswitch/trunk/src/mod/say/mod_say_de/mod_say_de.c (original) +++ freeswitch/trunk/src/mod/say/mod_say_de/mod_say_de.c Mon Jul 28 12:13:52 2008 @@ -236,28 +236,24 @@ static switch_status_t de_ip(switch_core_session_t *session, char *tosay, switch_say_type_t type, switch_say_method_t method, switch_input_args_t *args) { char *a, *b, *c, *d; - switch_status_t status = SWITCH_STATUS_SUCCESS; - if (!(a = strdup(tosay))) { + if (!(a = switch_core_session_strdup(session, tosay))) { return SWITCH_STATUS_FALSE; } if (!(b = strchr(a, '.'))) { - status = SWITCH_STATUS_FALSE; - goto done; + return SWITCH_STATUS_FALSE; } *b++ = '\0'; if (!(c = strchr(b, '.'))) { - status = SWITCH_STATUS_FALSE; - goto done; + return SWITCH_STATUS_FALSE; } *c++ = '\0'; if (!(d = strchr(c, '.'))) { - status = SWITCH_STATUS_FALSE; - goto done; + return SWITCH_STATUS_FALSE; } *d++ = '\0'; @@ -270,9 +266,7 @@ say_file("digits/dot.wav"); say_num(atoi(d), method); - done: - switch_safe_free(a); - return status; + return SWITCH_STATUS_SUCCESS; } Modified: freeswitch/trunk/src/mod/say/mod_say_en/mod_say_en.c ============================================================================== --- freeswitch/trunk/src/mod/say/mod_say_en/mod_say_en.c (original) +++ freeswitch/trunk/src/mod/say/mod_say_en/mod_say_en.c Mon Jul 28 12:13:52 2008 @@ -225,28 +225,24 @@ static switch_status_t en_ip(switch_core_session_t *session, char *tosay, switch_say_type_t type, switch_say_method_t method, switch_input_args_t *args) { char *a, *b, *c, *d; - switch_status_t status = SWITCH_STATUS_SUCCESS; - if (!(a = strdup(tosay))) { + if (!(a = switch_core_session_strdup(session, tosay))) { return SWITCH_STATUS_FALSE; } if (!(b = strchr(a, '.'))) { - status = SWITCH_STATUS_FALSE; - goto done; + return SWITCH_STATUS_FALSE; } *b++ = '\0'; if (!(c = strchr(b, '.'))) { - status = SWITCH_STATUS_FALSE; - goto done; + return SWITCH_STATUS_FALSE; } *c++ = '\0'; if (!(d = strchr(c, '.'))) { - status = SWITCH_STATUS_FALSE; - goto done; + return SWITCH_STATUS_FALSE; } *d++ = '\0'; @@ -259,9 +255,7 @@ say_file("digits/dot.wav"); say_num(atoi(d), method); - done: - switch_safe_free(a); - return status; + return SWITCH_STATUS_SUCCESS; } Modified: freeswitch/trunk/src/mod/say/mod_say_es/mod_say_es.c ============================================================================== --- freeswitch/trunk/src/mod/say/mod_say_es/mod_say_es.c (original) +++ freeswitch/trunk/src/mod/say/mod_say_es/mod_say_es.c Mon Jul 28 12:13:52 2008 @@ -225,28 +225,24 @@ static switch_status_t es_ip(switch_core_session_t *session, char *tosay, switch_say_type_t type, switch_say_method_t method, switch_input_args_t *args) { char *a, *b, *c, *d; - switch_status_t status = SWITCH_STATUS_SUCCESS; - if (!(a = strdup(tosay))) { + if (!(a = switch_core_session_strdup(session, tosay))) { return SWITCH_STATUS_FALSE; } if (!(b = strchr(a, '.'))) { - status = SWITCH_STATUS_FALSE; - goto done; + return SWITCH_STATUS_FALSE; } *b++ = '\0'; if (!(c = strchr(b, '.'))) { - status = SWITCH_STATUS_FALSE; - goto done; + return SWITCH_STATUS_FALSE; } *c++ = '\0'; if (!(d = strchr(c, '.'))) { - status = SWITCH_STATUS_FALSE; - goto done; + return SWITCH_STATUS_FALSE; } *d++ = '\0'; @@ -259,9 +255,7 @@ say_file("digits/dot.wav"); say_num(atoi(d), method); - done: - switch_safe_free(a); - return status; + return SWITCH_STATUS_SUCCESS; } Modified: freeswitch/trunk/src/mod/say/mod_say_fr/mod_say_fr.c ============================================================================== --- freeswitch/trunk/src/mod/say/mod_say_fr/mod_say_fr.c (original) +++ freeswitch/trunk/src/mod/say/mod_say_fr/mod_say_fr.c Mon Jul 28 12:13:52 2008 @@ -225,28 +225,24 @@ static switch_status_t fr_ip(switch_core_session_t *session, char *tosay, switch_say_type_t type, switch_say_method_t method, switch_input_args_t *args) { char *a, *b, *c, *d; - switch_status_t status = SWITCH_STATUS_SUCCESS; - if (!(a = strdup(tosay))) { + if (!(a = switch_core_session_strdup(session, tosay))) { return SWITCH_STATUS_FALSE; } if (!(b = strchr(a, '.'))) { - status = SWITCH_STATUS_FALSE; - goto done; + return SWITCH_STATUS_FALSE; } *b++ = '\0'; if (!(c = strchr(b, '.'))) { - status = SWITCH_STATUS_FALSE; - goto done; + return SWITCH_STATUS_FALSE; } *c++ = '\0'; if (!(d = strchr(c, '.'))) { - status = SWITCH_STATUS_FALSE; - goto done; + return SWITCH_STATUS_FALSE; } *d++ = '\0'; @@ -259,9 +255,7 @@ say_file("digits/dot.wav"); say_num(atoi(d), method); - done: - switch_safe_free(a); - return status; + return SWITCH_STATUS_SUCCESS; } Modified: freeswitch/trunk/src/mod/say/mod_say_it/mod_say_it.c ============================================================================== --- freeswitch/trunk/src/mod/say/mod_say_it/mod_say_it.c (original) +++ freeswitch/trunk/src/mod/say/mod_say_it/mod_say_it.c Mon Jul 28 12:13:52 2008 @@ -225,28 +225,24 @@ static switch_status_t it_ip(switch_core_session_t *session, char *tosay, switch_say_type_t type, switch_say_method_t method, switch_input_args_t *args) { char *a, *b, *c, *d; - switch_status_t status = SWITCH_STATUS_SUCCESS; - if (!(a = strdup(tosay))) { + if (!(a = switch_core_session_strdup(session, tosay))) { return SWITCH_STATUS_FALSE; } if (!(b = strchr(a, '.'))) { - status = SWITCH_STATUS_FALSE; - goto done; + return SWITCH_STATUS_FALSE; } *b++ = '\0'; if (!(c = strchr(b, '.'))) { - status = SWITCH_STATUS_FALSE; - goto done; + return SWITCH_STATUS_FALSE; } *c++ = '\0'; if (!(d = strchr(c, '.'))) { - status = SWITCH_STATUS_FALSE; - goto done; + return SWITCH_STATUS_FALSE; } *d++ = '\0'; @@ -259,9 +255,7 @@ say_file("digits/dot.wav"); say_num(atoi(d), method); - done: - switch_safe_free(a); - return status; + return SWITCH_STATUS_SUCCESS; } Modified: freeswitch/trunk/src/mod/say/mod_say_nl/mod_say_nl.c ============================================================================== --- freeswitch/trunk/src/mod/say/mod_say_nl/mod_say_nl.c (original) +++ freeswitch/trunk/src/mod/say/mod_say_nl/mod_say_nl.c Mon Jul 28 12:13:52 2008 @@ -225,28 +225,24 @@ static switch_status_t nl_ip(switch_core_session_t *session, char *tosay, switch_say_type_t type, switch_say_method_t method, switch_input_args_t *args) { char *a, *b, *c, *d; - switch_status_t status = SWITCH_STATUS_SUCCESS; - if (!(a = strdup(tosay))) { + if (!(a = switch_core_session_strdup(session, tosay))) { return SWITCH_STATUS_FALSE; } if (!(b = strchr(a, '.'))) { - status = SWITCH_STATUS_FALSE; - goto done; + return SWITCH_STATUS_FALSE; } *b++ = '\0'; if (!(c = strchr(b, '.'))) { - status = SWITCH_STATUS_FALSE; - goto done; + return SWITCH_STATUS_FALSE; } *c++ = '\0'; if (!(d = strchr(c, '.'))) { - status = SWITCH_STATUS_FALSE; - goto done; + return SWITCH_STATUS_FALSE; } *d++ = '\0'; @@ -259,9 +255,7 @@ say_file("digits/dot.wav"); say_num(atoi(d), method); - done: - switch_safe_free(a); - return status; + return SWITCH_STATUS_SUCCESS; } Modified: freeswitch/trunk/src/mod/say/mod_say_zh/mod_say_zh.2008.vcproj ============================================================================== --- freeswitch/trunk/src/mod/say/mod_say_zh/mod_say_zh.2008.vcproj (original) +++ freeswitch/trunk/src/mod/say/mod_say_zh/mod_say_zh.2008.vcproj Mon Jul 28 12:13:52 2008 @@ -3,7 +3,7 @@ ProjectType="Visual C++" Version="9.00" Name="mod_say_zh" - ProjectGUID="{988CACF7-3FCB-4992-BE69-77872AE67DC8}" + ProjectGUID="{B6A9FB7A-1CC4-442B-812D-EC33E4E4A36E}" RootNamespace="mod_say_zh" Keyword="Win32Proj" TargetFrameworkVersion="131072" Modified: freeswitch/trunk/src/mod/say/mod_say_zh/mod_say_zh.c ============================================================================== --- freeswitch/trunk/src/mod/say/mod_say_zh/mod_say_zh.c (original) +++ freeswitch/trunk/src/mod/say/mod_say_zh/mod_say_zh.c Mon Jul 28 12:13:52 2008 @@ -290,51 +290,41 @@ } -static switch_status_t zh_ip(switch_core_session_t *session, char *tosay, switch_say_type_t type, switch_say_method_t method, switch_input_args_t *args) -{ - char *a; - char *b; - char *c; - char *d; - - switch_status_t status = SWITCH_STATUS_SUCCESS; - if (!(a = strdup(tosay))) { - return SWITCH_STATUS_FALSE; - } - - if (!(b = strchr(a, '.'))) { - status = SWITCH_STATUS_FALSE; - goto done; - } - - *b++ = '\0'; - - if (!(c = strchr(b, '.'))) { - status = SWITCH_STATUS_FALSE; - goto done; - } - - *c++ = '\0'; - - if (!(d = strchr(c, '.'))) { - status = SWITCH_STATUS_FALSE; - goto done; - } - - *d++ = '\0'; - - say_num(atoi(a), method); - say_file("digits/dot.wav"); - say_num(atoi(b), method); - say_file("digits/dot.wav"); - say_num(atoi(c), method); - say_file("digits/dot.wav"); - say_num(atoi(d), method); - -done: - switch_safe_free(a); - return status; -} +static switch_status_t zh_ip(switch_core_session_t *session, char *tosay, switch_say_type_t type, switch_say_method_t method, switch_input_args_t *args) +{ + char *a, *b, *c, *d; + if (!(a = switch_core_session_strdup(session, tosay))) { + return SWITCH_STATUS_FALSE; + } + + if (!(b = strchr(a, '.'))) { + return SWITCH_STATUS_FALSE; + } + + *b++ = '\0'; + + if (!(c = strchr(b, '.'))) { + return SWITCH_STATUS_FALSE; + } + + *c++ = '\0'; + + if (!(d = strchr(c, '.'))) { + return SWITCH_STATUS_FALSE; + } + + *d++ = '\0'; + + say_num(atoi(a), method); + say_file("digits/dot.wav"); + say_num(atoi(b), method); + say_file("digits/dot.wav"); + say_num(atoi(c), method); + say_file("digits/dot.wav"); + say_num(atoi(d), method); + + return SWITCH_STATUS_SUCCESS; +} static switch_status_t zh_say_time(switch_core_session_t *session, char *tosay,
participants (1)
-
Freeswitch SVN