diff --git a/main/pbx.c b/main/pbx.c index e370ae7431..241d0641a7 100644 --- a/main/pbx.c +++ b/main/pbx.c @@ -8239,6 +8239,8 @@ int ast_build_timing(struct ast_timing *i, const char *info_in) char *info; int j, num_fields, last_sep = -1; + i->timezone = NULL; + /* Check for empty just in case */ if (ast_strlen_zero(info_in)) { return 0; @@ -8258,8 +8260,6 @@ int ast_build_timing(struct ast_timing *i, const char *info_in) /* save the timezone, if it is specified */ if (num_fields == 5) { i->timezone = ast_strdup(info + last_sep + 1); - } else { - i->timezone = NULL; } /* Assume everything except time */ diff --git a/utils/extconf.c b/utils/extconf.c index 99df9e9ec1..7131e13b17 100644 --- a/utils/extconf.c +++ b/utils/extconf.c @@ -4439,6 +4439,8 @@ int ast_build_timing(struct ast_timing *i, const char *info_in) char *info; int j, num_fields, last_sep = -1; + i->timezone = NULL; + /* Check for empty just in case */ if (ast_strlen_zero(info_in)) { return 0; @@ -4458,8 +4460,6 @@ int ast_build_timing(struct ast_timing *i, const char *info_in) /* save the timezone, if it is specified */ if (num_fields == 5) { i->timezone = ast_strdup(info + last_sep + 1); - } else { - i->timezone = NULL; } /* Assume everything except time */