Commit 872fe00e authored by François Grisez's avatar François Grisez

Fixes crash when starting a call at the first time

parent 4836f295
......@@ -818,13 +818,13 @@ bool_t lp_config_relative_file_exists(const LpConfig *lpconfig, const char *file
if (lpconfig->filename == NULL) {
return FALSE;
} else {
char *filename = ms_strdup(lpconfig->filename);
const char *dir = _lp_config_dirname(filename);
char *conf_path = ms_strdup(lpconfig->filename);
const char *dir = _lp_config_dirname(conf_path);
char *filepath = ms_strdup_printf("%s/%s", dir, filename);
char *realfilepath = lp_realpath(filepath, NULL);
FILE *file;
ms_free(filename);
ms_free(conf_path);
ms_free(filepath);
if(realfilepath == NULL) return FALSE;
......@@ -912,7 +912,7 @@ int lp_config_read_relative_file(const LpConfig *lpconfig, const char *filename,
return 0;
err:
ms_free(filepath);
ms_free(dup_config_file);
ms_free(filepath);
if(realfilepath) ms_free(realfilepath);
return -1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment