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

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