Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > ebe084c140192657f9094e135a84202c > files > 76

libvirt-0.8.2-29.el5.src.rpm

From e2f99b626ffce3b5c669d00442c87e628dc3b16f Mon Sep 17 00:00:00 2001
Message-Id: <e2f99b626ffce3b5c669d00442c87e628dc3b16f.1302077893.git.jdenemar@redhat.com>
From: Jiri Denemark <jdenemar@redhat.com>
Date: Fri, 25 Mar 2011 12:03:00 +0100
Subject: [PATCH] daemon: Avoid resetting errors before they are reported

https://bugzilla.redhat.com/show_bug.cgi?id=690733

Commit f44bfb7 was supposed to make sure no additional libvirt API (esp.
*Free) is called before remoteDispatchConnError() is called on error.
However, the patch missed two instances.
(cherry picked from commit 55cc591fc18e87b29febf78dc5b424b7c12f7349)
---
 daemon/remote.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/daemon/remote.c b/daemon/remote.c
index 9d41ac9..1739f0d 100644
--- a/daemon/remote.c
+++ b/daemon/remote.c
@@ -4533,12 +4533,13 @@ remoteDispatchStoragePoolListVolumes (struct qemud_server *server ATTRIBUTE_UNUS
     ret->names.names_len =
         virStoragePoolListVolumes (pool,
                                    ret->names.names_val, args->maxnames);
-    virStoragePoolFree(pool);
     if (ret->names.names_len == -1) {
         VIR_FREE(ret->names.names_val);
         remoteDispatchConnError(rerr, conn);
+        virStoragePoolFree(pool);
         return -1;
     }
+    virStoragePoolFree(pool);
 
     return 0;
 }
@@ -4562,11 +4563,12 @@ remoteDispatchStoragePoolNumOfVolumes (struct qemud_server *server ATTRIBUTE_UNU
     }
 
     ret->num = virStoragePoolNumOfVolumes (pool);
-    virStoragePoolFree(pool);
     if (ret->num == -1) {
         remoteDispatchConnError(rerr, conn);
+        virStoragePoolFree(pool);
         return -1;
     }
+    virStoragePoolFree(pool);
 
     return 0;
 }
-- 
1.7.4.1