Try to prevent null pointer dereference

This commit is contained in:
twinaphex 2017-05-09 20:45:09 +02:00
parent 06f5f635ca
commit 5a9f6ad9b7

View File

@ -270,8 +270,9 @@ static void add_sub_conf(config_file_t *conf, char *line)
real_path[0] = '\0';
#ifdef _WIN32
fill_pathname_resolve_relative(real_path, conf->path,
path, sizeof(real_path));
if (!string_is_empty(conf->path))
fill_pathname_resolve_relative(real_path, conf->path,
path, sizeof(real_path));
#else
#ifndef __CELLOS_LV2__
if (*path == '~')
@ -282,8 +283,9 @@ static void add_sub_conf(config_file_t *conf, char *line)
}
else
#endif
fill_pathname_resolve_relative(real_path, conf->path,
path, sizeof(real_path));
if (!string_is_empty(conf->path))
fill_pathname_resolve_relative(real_path, conf->path,
path, sizeof(real_path));
#endif
sub_conf = (config_file_t*)