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:
Anna Schumaker 2016-03-31 14:20:44 -04:00
parent 8034a64f17
commit 09e900eadf
1 changed files with 1 additions and 1 deletions

View File

@ -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;
}