Blame SOURCES/0217-report-newt-free-allocated-variables-don-t-close-dd-.patch

28bab8
From 79d5c0352a09fc1bfe8cc491b33a745ac33b7855 Mon Sep 17 00:00:00 2001
28bab8
From: Matej Habrnal <mhabrnal@redhat.com>
28bab8
Date: Tue, 21 Feb 2017 12:08:13 +0100
28bab8
Subject: [PATCH] report-newt: free allocated variables, don't close dd twice
28bab8
28bab8
Uncovered by coverity.
28bab8
28bab8
Related #1257159
28bab8
28bab8
Signed-off-by: Matej Habrnal <mhabrnal@redhat.com>
28bab8
---
28bab8
 src/report-newt/report-newt.c | 6 +++++-
28bab8
 1 file changed, 5 insertions(+), 1 deletion(-)
28bab8
28bab8
diff --git a/src/report-newt/report-newt.c b/src/report-newt/report-newt.c
28bab8
index 278cfb7..2427d86 100644
28bab8
--- a/src/report-newt/report-newt.c
28bab8
+++ b/src/report-newt/report-newt.c
28bab8
@@ -333,12 +333,16 @@ static int report(const char *dump_dir_name)
28bab8
                             not_reportable ? " " : "",
28bab8
                             reason ? : _("(no description)"));
28bab8
 
28bab8
-        dd_close(dd);
28bab8
         newtWinMessage(_("Error"), _("Ok"), (char *)"%s", t);
28bab8
         free(t);
28bab8
+        free(not_reportable);
28bab8
+        free(reason);
28bab8
 
28bab8
         if (get_global_stop_on_not_reportable())
28bab8
+        {
28bab8
+            dd_close(dd);
28bab8
             return -1;
28bab8
+        }
28bab8
     }
28bab8
 
28bab8
     dd_close(dd);
28bab8
-- 
28bab8
1.8.3.1
28bab8