1146600
From 41b6477bdeaa82c647db2f1c2ba1132c77b365ed Mon Sep 17 00:00:00 2001
1146600
From: =?UTF-8?q?Mat=C4=9Bj=20Grabovsk=C3=BD?= <mgrabovs@redhat.com>
1146600
Date: Tue, 29 Sep 2020 14:43:15 +0200
1146600
Subject: [PATCH 2/2] event_config: Null autofree pointers before returning
1146600
1146600
The pointers to strings in the function check_problem_rating_usability()
1146600
need to be nullified before the function returns as they are declared
1146600
for auto-cleanup.
1146600
1146600
This change fixes a double-free condition in which the returned strings
1146600
were attempted to be freed again in the caller,
1146600
is_backtrace_rating_usable().
1146600
1146600
Bug was introduced in 05e9c9273.
1146600
1146600
Resolves rhbz#1883410
1146600
---
1146600
 src/lib/event_config.c | 4 ++--
1146600
 1 file changed, 2 insertions(+), 2 deletions(-)
1146600
1146600
diff --git a/src/lib/event_config.c b/src/lib/event_config.c
1146600
index c8053b7c..01e91efe 100644
1146600
--- a/src/lib/event_config.c
1146600
+++ b/src/lib/event_config.c
1146600
@@ -541,10 +541,10 @@ bool check_problem_rating_usability(const event_config_t *cfg,
1146600
 
1146600
 finish:
1146600
     if (description)
1146600
-        *description = tmp_desc;
1146600
+        *description = g_steal_pointer(&tmp_desc);
1146600
 
1146600
     if (detail)
1146600
-        *detail = tmp_detail;
1146600
+        *detail = g_steal_pointer(&tmp_detail);
1146600
 
1146600
     return result;
1146600
 }
1146600
-- 
1146600
2.26.2
1146600