]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[mod_say_pl] Fix potential memory leak in pl_say_ip()
authorAndrey Volk <andywolk@gmail.com>
Sat, 3 Apr 2021 17:38:30 +0000 (20:38 +0300)
committerAndrey Volk <andywolk@gmail.com>
Tue, 19 Oct 2021 17:24:09 +0000 (20:24 +0300)
src/mod/say/mod_say_pl/mod_say_pl.c

index 02fb4e15a366e9c892c7d5e2681950a5751d6097..4030b963912aa21daf930a2bc6c3816b09271b7a 100644 (file)
@@ -65,7 +65,7 @@ SWITCH_MODULE_DEFINITION(mod_say_pl, mod_say_pl_load, NULL, NULL);
                if ((tstatus =                                                                                                  \
                         pl_say_general_count(_sh, tmp, say_args))                                      \
                        != SWITCH_STATUS_SUCCESS) {                                                                     \
-                       return tstatus;                                                                                         \
+                       switch_goto_status(tstatus, end);                                                       \
                }                                                                                                                               \
                say_args->method = smeth; say_args->type = stype;                               \
                say_args->gender = sgen;                                                                                \
@@ -206,6 +206,7 @@ static switch_status_t pl_say_time(switch_say_file_handle_t *sh, char *tosay, sw
        switch_time_exp_t tm, tm_now;
        uint8_t say_date = 0, say_time = 0, say_year = 0, say_month = 0, say_dow = 0, say_day = 0, say_yesterday = 0, say_today = 0;
        const char *tz = NULL;
+       switch_status_t status = SWITCH_STATUS_SUCCESS;
 
        tz = switch_say_file_handle_get_variable(sh, "timezone");
 
@@ -304,7 +305,7 @@ static switch_status_t pl_say_time(switch_say_file_handle_t *sh, char *tosay, sw
                        switch_say_file(sh, "time/t_sekund");
                }
 
-               return SWITCH_STATUS_SUCCESS;
+               switch_goto_status(SWITCH_STATUS_SUCCESS, end);
        }
 
        if ((t = atol(tosay)) > 0) {
@@ -409,7 +410,8 @@ static switch_status_t pl_say_time(switch_say_file_handle_t *sh, char *tosay, sw
                /* switch_say_file(sh, "digits/t_minut");*/
        }
 
-       return SWITCH_STATUS_SUCCESS;
+end:
+       return status;
 }