core/file: Free "dir" after reporting possible errors
Otherwise we're reading memory that has already been freed. Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This commit is contained in:
parent
8034a64f17
commit
09e900eadf
|
@ -27,9 +27,9 @@ static bool __file_mkdir()
|
|||
gchar *dir = __file_path(NULL);
|
||||
int ret = g_mkdir_with_parents(dir, 0755);
|
||||
|
||||
g_free(dir);
|
||||
if (ret != 0)
|
||||
REPORT_ERROR(dir);
|
||||
g_free(dir);
|
||||
return ret == 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue