diff --git a/libretro-common/file/config_file.c b/libretro-common/file/config_file.c index 692176b76a..af22bf753a 100644 --- a/libretro-common/file/config_file.c +++ b/libretro-common/file/config_file.c @@ -142,14 +142,14 @@ static char *extract_value(char *line, bool is_value) { line++; if (*line == '"') - return strdup(""); + return NULL; tok = strtok_r(line, "\"", &save); } /* We don't have that. Read until next space. */ else if (*line != '\0') /* Nothing */ tok = strtok_r(line, " \n\t\f\r\v", &save); - if (tok) + if (tok && *tok) return strdup(tok); return NULL; }