eolian: fix use after free in eolian_database

'toscan' is actually a view to 'mpath' memory, so freeing it first
would result in use-after-free. This is obviously only in the error
branch so it usually does not happen, but fix anyway.

CID1403022
This commit is contained in:
Daniel Kolesa 2019-08-05 15:43:39 +02:00
parent 4f50a9728d
commit 4c6a9520ef
1 changed files with 1 additions and 1 deletions

View File

@ -1104,8 +1104,8 @@ eolian_state_file_path_parse(Eolian_State *state, const char *filepath)
if (!eolian_state_directory_add(state, toscan))
{
free(mpath);
eolian_state_log(state, "could not scan directory '%s'", toscan);
free(mpath);
return NULL;
}
unit = eolian_state_file_parse(state, fname);