From 09e900eadf53759488971e59258d95b57d871cfd Mon Sep 17 00:00:00 2001 From: Anna Schumaker Date: Thu, 31 Mar 2016 14:20:44 -0400 Subject: [PATCH] core/file: Free "dir" after reporting possible errors Otherwise we're reading memory that has already been freed. Signed-off-by: Anna Schumaker --- core/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/file.c b/core/file.c index 38464fbb..ad54e17b 100644 --- a/core/file.c +++ b/core/file.c @@ -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; }