diff --git a/libs/freetdm/src/include/zap_config.h b/libs/freetdm/src/include/zap_config.h index f239fa933e..0b37208666 100644 --- a/libs/freetdm/src/include/zap_config.h +++ b/libs/freetdm/src/include/zap_config.h @@ -77,7 +77,7 @@ struct zap_config { /*! FILE stream buffer to the opened file */ FILE *file; /*! path to the file */ - const char *path; + char path[512]; /*! current category */ char category[256]; /*! current section */ diff --git a/libs/freetdm/src/zap_config.c b/libs/freetdm/src/zap_config.c index 4c9aaa957d..f27fa04621 100644 --- a/libs/freetdm/src/zap_config.c +++ b/libs/freetdm/src/zap_config.c @@ -69,7 +69,7 @@ int zap_config_open_file(zap_config_t *cfg, const char *file_path) } cfg->file = f; - cfg->path = path; + zap_set_string(cfg->path, path); while (zap_config_next_pair(cfg, &var, &val)) { if ((cfg->sectno != last) && !strcmp(cfg->section, file_path)) { @@ -86,7 +86,7 @@ int zap_config_open_file(zap_config_t *cfg, const char *file_path) return 0; } else { cfg->file = f; - cfg->path = path; + zap_set_string(cfg->path, path); return 1; } }