Blame SOURCES/0044-proxy-Don-t-try-to-unref-NULL-root-node.patch

2aba60
From 8032575cbe274c9e70ec2a0efb0b536f13dbc6cd Mon Sep 17 00:00:00 2001
2aba60
From: Christophe Fergeau <cfergeau@redhat.com>
2aba60
Date: Fri, 21 Dec 2018 13:15:16 +0100
2aba60
Subject: [PATCH] proxy: Don't try to unref NULL root node
2aba60
2aba60
When an error occurs, we may have failed to get any data, so 'root' may
2aba60
be NULL. Trying to unref it triggers a critical. This happens for
2aba60
example when trying to connect to a remote host with an invalid
2aba60
certificate.
2aba60
---
2aba60
 govirt/ovirt-proxy.c | 4 +++-
2aba60
 1 file changed, 3 insertions(+), 1 deletion(-)
2aba60
2aba60
diff --git a/govirt/ovirt-proxy.c b/govirt/ovirt-proxy.c
2aba60
index f8e629e..920ef21 100644
2aba60
--- a/govirt/ovirt-proxy.c
2aba60
+++ b/govirt/ovirt-proxy.c
2aba60
@@ -253,7 +253,9 @@ static void rest_call_async_set_error(RestProxyCall *call, GSimpleAsyncResult *r
2aba60
         g_simple_async_result_set_from_error(result, error);
2aba60
     }
2aba60
 
2aba60
-    rest_xml_node_unref(root);
2aba60
+    if (root != NULL) {
2aba60
+        rest_xml_node_unref(root);
2aba60
+    }
2aba60
 }
2aba60
 
2aba60
 static void
2aba60
-- 
2aba60
2.20.1
2aba60