]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fix leak when call hangs up or other error condition while saying an ip address ...
authorMichael Jerris <mike@jerris.com>
Mon, 28 Jul 2008 16:13:52 +0000 (16:13 +0000)
committerMichael Jerris <mike@jerris.com>
Mon, 28 Jul 2008 16:13:52 +0000 (16:13 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9184 d0543943-73ff-0310-b7d9-9358b9ac24b2

Freeswitch.2008.sln
src/mod/say/mod_say_de/mod_say_de.c
src/mod/say/mod_say_en/mod_say_en.c
src/mod/say/mod_say_es/mod_say_es.c
src/mod/say/mod_say_fr/mod_say_fr.c
src/mod/say/mod_say_it/mod_say_it.c
src/mod/say/mod_say_nl/mod_say_nl.c
src/mod/say/mod_say_zh/mod_say_zh.2008.vcproj
src/mod/say/mod_say_zh/mod_say_zh.c

index 5ca0ba9cb09f79a4c81b68de21d8fbd69345e18f..0d2e5a0a0d6c69005319fe93516f3bb9afbe7bc0 100644 (file)
@@ -961,6 +961,11 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_snom", "src\mod\applica
                {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}\r
        EndProjectSection\r
 EndProject\r
+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}"\r
+       ProjectSection(ProjectDependencies) = postProject\r
+               {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF}\r
+       EndProjectSection\r
+EndProject\r
 Global\r
        GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
                Debug|Win32 = Debug|Win32\r
@@ -1662,6 +1667,12 @@ Global
                {2A3D00C6-588D-4E86-81AC-9EF5EDE86E03}.Release|Win32.ActiveCfg = Release|Win32\r
                {2A3D00C6-588D-4E86-81AC-9EF5EDE86E03}.Release|Win32.Build.0 = Release|Win32\r
                {2A3D00C6-588D-4E86-81AC-9EF5EDE86E03}.Release|x64.ActiveCfg = Release|Win32\r
+               {B6A9FB7A-1CC4-442B-812D-EC33E4E4A36E}.Debug|Win32.ActiveCfg = Debug|Win32\r
+               {B6A9FB7A-1CC4-442B-812D-EC33E4E4A36E}.Debug|Win32.Build.0 = Debug|Win32\r
+               {B6A9FB7A-1CC4-442B-812D-EC33E4E4A36E}.Debug|x64.ActiveCfg = Debug|Win32\r
+               {B6A9FB7A-1CC4-442B-812D-EC33E4E4A36E}.Release|Win32.ActiveCfg = Release|Win32\r
+               {B6A9FB7A-1CC4-442B-812D-EC33E4E4A36E}.Release|Win32.Build.0 = Release|Win32\r
+               {B6A9FB7A-1CC4-442B-812D-EC33E4E4A36E}.Release|x64.ActiveCfg = Release|Win32\r
        EndGlobalSection\r
        GlobalSection(SolutionProperties) = preSolution\r
                HideSolutionNode = FALSE\r
@@ -1771,6 +1782,7 @@ Global
                {06E3A538-AB32-44F2-B477-755FF9CB5D37} = {6CD61A1D-797C-470A-BE08-8C31B68BB336}\r
                {6D1BEC70-4DCD-4FE9-ADBD-4A43A67E4D05} = {6CD61A1D-797C-470A-BE08-8C31B68BB336}\r
                {A4B122CF-5196-476B-8C0E-D8BD59AC3C14} = {6CD61A1D-797C-470A-BE08-8C31B68BB336}\r
+               {B6A9FB7A-1CC4-442B-812D-EC33E4E4A36E} = {6CD61A1D-797C-470A-BE08-8C31B68BB336}\r
                {3B08FEFD-4D3D-4C16-BA94-EE83509E32A0} = {57D119DC-484F-420F-B9E9-8589FD9A8DF8}\r
                {7BFD517E-7F8F-4A40-A78E-8D3632738227} = {57D119DC-484F-420F-B9E9-8589FD9A8DF8}\r
                {6374D55C-FABE-4A02-9CF1-4145308A56C5} = {57D119DC-484F-420F-B9E9-8589FD9A8DF8}\r
index cd2b3a37d5fc65aa307815d4f137496a68c5c95e..b3ad8e54728f1a44045f2ed3b66e8144fd895a25 100644 (file)
@@ -236,28 +236,24 @@ static switch_status_t de_say_general_count(switch_core_session_t *session,
 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 @@ static switch_status_t de_ip(switch_core_session_t *session, char *tosay, switch
        say_file("digits/dot.wav");
        say_num(atoi(d), method);
 
-  done:
-       switch_safe_free(a);
-       return status;
+       return SWITCH_STATUS_SUCCESS;
 }
 
 
index e711473249f8165322a92b160020244fec8e014d..9932940c262e74d4acd3d65910334b0b917a7151 100644 (file)
@@ -225,28 +225,24 @@ static switch_status_t en_say_general_count(switch_core_session_t *session,
 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 @@ static switch_status_t en_ip(switch_core_session_t *session, char *tosay, switch
        say_file("digits/dot.wav");
        say_num(atoi(d), method);
 
-  done:
-       switch_safe_free(a);
-       return status;
+       return SWITCH_STATUS_SUCCESS;
 }
 
 
index 3dc368f19584e454487693185a1b213332b35277..dea585740dbf6f86cc28d94955c0c1ad09998b43 100644 (file)
@@ -225,28 +225,24 @@ static switch_status_t es_say_general_count(switch_core_session_t *session,
 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 @@ static switch_status_t es_ip(switch_core_session_t *session, char *tosay, switch
        say_file("digits/dot.wav");
        say_num(atoi(d), method);
 
-  done:
-       switch_safe_free(a);
-       return status;
+       return SWITCH_STATUS_SUCCESS;
 }
 
 
index 75b3f70ba1d193437fb722fe8a83137c1bcfa10b..32304a44646e62d8ba7238fa31a3115162e55d6b 100644 (file)
@@ -225,28 +225,24 @@ static switch_status_t fr_say_general_count(switch_core_session_t *session,
 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 @@ static switch_status_t fr_ip(switch_core_session_t *session, char *tosay, switch
        say_file("digits/dot.wav");
        say_num(atoi(d), method);
 
-  done:
-       switch_safe_free(a);
-       return status;
+       return SWITCH_STATUS_SUCCESS;
 }
 
 
index d0c85a388e48a45af820996b367e2badf5cfa3ef..b1bb4d0f4748903cc22451f71374fa67641c7677 100644 (file)
@@ -225,28 +225,24 @@ static switch_status_t it_say_general_count(switch_core_session_t *session,
 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 @@ static switch_status_t it_ip(switch_core_session_t *session, char *tosay, switch
        say_file("digits/dot.wav");
        say_num(atoi(d), method);
 
-  done:
-       switch_safe_free(a);
-       return status;
+       return SWITCH_STATUS_SUCCESS;
 }
 
 
index d19e11b042eb14ec891eee491f1124d00048684e..6342015351c2e81809d4909135542a4f16980470 100644 (file)
@@ -225,28 +225,24 @@ static switch_status_t nl_say_general_count(switch_core_session_t *session,
 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 @@ static switch_status_t nl_ip(switch_core_session_t *session, char *tosay, switch
        say_file("digits/dot.wav");
        say_num(atoi(d), method);
 
-  done:
-       switch_safe_free(a);
-       return status;
+       return SWITCH_STATUS_SUCCESS;
 }
 
 
index 386a2361ebcb943d5a30a3f9031aa09b114176ed..1869113bfff316f07d514633bdb40cfe90d8df6b 100644 (file)
@@ -3,7 +3,7 @@
        ProjectType="Visual C++"\r
        Version="9.00"\r
        Name="mod_say_zh"\r
-       ProjectGUID="{988CACF7-3FCB-4992-BE69-77872AE67DC8}"\r
+       ProjectGUID="{B6A9FB7A-1CC4-442B-812D-EC33E4E4A36E}"\r
        RootNamespace="mod_say_zh"\r
        Keyword="Win32Proj"\r
        TargetFrameworkVersion="131072"\r
index fb186e1460bbc95fefaf10e273e6fd5841cc5497..2c5f07ecbfaf3dbbeb7316c2940887b6e60cafd1 100644 (file)
@@ -290,51 +290,41 @@ static switch_status_t zh_say_general_count(switch_core_session_t *session,
 }
 
 
-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)\r
+{\r
+       char *a, *b, *c, *d;\r
+       if (!(a = switch_core_session_strdup(session, tosay))) {\r
+               return SWITCH_STATUS_FALSE;\r
+       }\r
+\r
+       if (!(b = strchr(a, '.'))) {\r
+               return SWITCH_STATUS_FALSE;\r
+       }\r
+\r
+       *b++ = '\0';\r
+\r
+       if (!(c = strchr(b, '.'))) {\r
+               return SWITCH_STATUS_FALSE;\r
+       }\r
+\r
+       *c++ = '\0';\r
+\r
+       if (!(d = strchr(c, '.'))) {\r
+               return SWITCH_STATUS_FALSE;\r
+       }\r
+\r
+       *d++ = '\0';\r
+\r
+       say_num(atoi(a), method);\r
+       say_file("digits/dot.wav");\r
+       say_num(atoi(b), method);\r
+       say_file("digits/dot.wav");\r
+       say_num(atoi(c), method);\r
+       say_file("digits/dot.wav");\r
+       say_num(atoi(d), method);\r
+\r
+       return SWITCH_STATUS_SUCCESS;\r
+}\r
 
 static switch_status_t zh_say_time(switch_core_session_t *session,
                                                                   char *tosay,