8086e64
From cf78b299371995cbd7607a536f4b1469c09b40cf Mon Sep 17 00:00:00 2001
8086e64
From: Ernestas Kulik <ekulik@redhat.com>
8086e64
Date: Sat, 12 Jan 2019 10:50:24 +0100
8086e64
Subject: [PATCH] applet: application: Fix use after free
8086e64
MIME-Version: 1.0
8086e64
Content-Type: text/plain; charset=UTF-8
8086e64
Content-Transfer-Encoding: 8bit
8086e64
8086e64
dirlist_name is erroneously freed before it’s used to create a
8086e64
directory.
8086e64
8086e64
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1665521
8086e64
8086e64
Signed-off-by: Ernestas Kulik <ekulik@redhat.com>
8086e64
---
8086e64
 src/applet/abrt-applet-application.c | 4 ++--
8086e64
 1 file changed, 2 insertions(+), 2 deletions(-)
8086e64
8086e64
diff --git a/src/applet/abrt-applet-application.c b/src/applet/abrt-applet-application.c
8086e64
index 6e7ac00a..4b1d9a3c 100644
8086e64
--- a/src/applet/abrt-applet-application.c
8086e64
+++ b/src/applet/abrt-applet-application.c
8086e64
@@ -296,10 +296,10 @@ new_dir_exists (GList **new_dirs)
8086e64
     cachedir = g_get_user_cache_dir ();
8086e64
     dirlist_name = concat_path_file (cachedir, "abrt");
8086e64
 
8086e64
-    g_free (dirlist_name);
8086e64
-
8086e64
     g_mkdir_with_parents (dirlist_name, 0777);
8086e64
 
8086e64
+    g_free (dirlist_name);
8086e64
+
8086e64
     dirlist_name = concat_path_file (cachedir, "abrt/applet_dirlist");
8086e64
     fp = fopen (dirlist_name, "r+");
8086e64
     if (fp == NULL)
8086e64
-- 
8086e64
2.20.1
8086e64