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:
parent
4f50a9728d
commit
4c6a9520ef
|
@ -1104,8 +1104,8 @@ eolian_state_file_path_parse(Eolian_State *state, const char *filepath)
|
||||||
|
|
||||||
if (!eolian_state_directory_add(state, toscan))
|
if (!eolian_state_directory_add(state, toscan))
|
||||||
{
|
{
|
||||||
free(mpath);
|
|
||||||
eolian_state_log(state, "could not scan directory '%s'", toscan);
|
eolian_state_log(state, "could not scan directory '%s'", toscan);
|
||||||
|
free(mpath);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
unit = eolian_state_file_parse(state, fname);
|
unit = eolian_state_file_parse(state, fname);
|
||||||
|
|
Loading…
Reference in New Issue