diff --git a/src/include/switch_config.h b/src/include/switch_config.h index f4f665f213..42de903ced 100644 --- a/src/include/switch_config.h +++ b/src/include/switch_config.h @@ -65,7 +65,7 @@ struct switch_config { /*! FILE stream buffer to the opened file */ FILE *file; /*! path to the file */ - char *path; + char path[512]; /*! current category */ char category[256]; /*! current section */ diff --git a/src/switch_config.c b/src/switch_config.c index 868a50b422..5a6979d52d 100644 --- a/src/switch_config.c +++ b/src/switch_config.c @@ -66,7 +66,7 @@ SWITCH_DECLARE(int) switch_config_open_file(switch_config_t * cfg, char *file_pa } cfg->file = f; - cfg->path = path; + switch_set_string(cfg->path, path); while (switch_config_next_pair(cfg, &var, &val)) { if (file_path && (cfg->sectno != last) && !strcmp(cfg->section, file_path)) { @@ -83,7 +83,7 @@ SWITCH_DECLARE(int) switch_config_open_file(switch_config_t * cfg, char *file_pa return 0; } else { cfg->file = f; - cfg->path = path; + switch_set_string(cfg->path, path); return 1; } }