Blame SOURCES/0105-rhtsupport-do-not-leak-the-hints-results.patch

0c9110
From d10be6466e36650ae0598772ece838c9df0f9188 Mon Sep 17 00:00:00 2001
0c9110
From: Jakub Filak <jfilak@redhat.com>
0c9110
Date: Wed, 22 Oct 2014 11:09:43 +0200
0c9110
Subject: [LIBREPORT PATCH 105/105] rhtsupport: do not leak the hints results
0c9110
0c9110
The leak was introduced in commit
0c9110
5ff7f36c1a06f5317241b43999f4f03a21594c79
0c9110
0c9110
Related to rhbz#1139987
0c9110
0c9110
Signed-off-by: Jakub Filak <jfilak@redhat.com>
0c9110
---
0c9110
 src/plugins/reporter-rhtsupport.c | 13 +++++++++----
0c9110
 1 file changed, 9 insertions(+), 4 deletions(-)
0c9110
0c9110
diff --git a/src/plugins/reporter-rhtsupport.c b/src/plugins/reporter-rhtsupport.c
0c9110
index 4b74c5c..add0d6b 100644
0c9110
--- a/src/plugins/reporter-rhtsupport.c
0c9110
+++ b/src/plugins/reporter-rhtsupport.c
0c9110
@@ -275,6 +275,7 @@ void attach_to_ureport(struct ureport_server_config *conf,
0c9110
 static
0c9110
 bool check_for_hints(const char *url, char **login, char **password, bool ssl_verify, const char *tempfile)
0c9110
 {
0c9110
+    bool retval = false;
0c9110
     rhts_result_t *result = NULL;
0c9110
 
0c9110
     INVALID_CREDENTIALS_LOOP((*login), (*password),
0c9110
@@ -317,14 +318,18 @@ bool check_for_hints(const char *url, char **login, char **password, bool ssl_ve
0c9110
             hint = append_to_malloced_string(hint,
0c9110
                     _("Do you still want to create a RHTSupport ticket?")
0c9110
                     );
0c9110
-            int create_ticket = ask_yes_no(hint);
0c9110
+
0c9110
+            /*
0c9110
+             * 'Yes' to the create ticket question means no hints were found.
0c9110
+             */
0c9110
+            retval = !ask_yes_no(hint);
0c9110
+
0c9110
             free(hint);
0c9110
-            if (!create_ticket)
0c9110
-                return true;
0c9110
         }
0c9110
     }
0c9110
+
0c9110
     free_rhts_result(result);
0c9110
-    return false;
0c9110
+    return retval;
0c9110
 }
0c9110
 
0c9110
 static
0c9110
-- 
0c9110
1.8.3.1
0c9110