]> xenbits.xensource.com Git - libvirt.git/commitdiff
daemon: Avoid resetting errors before they are reported
authorJiri Denemark <jdenemar@redhat.com>
Fri, 25 Mar 2011 11:03:00 +0000 (12:03 +0100)
committerJiri Denemark <jdenemar@redhat.com>
Fri, 25 Mar 2011 14:05:35 +0000 (15:05 +0100)
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.

daemon/remote.c

index d49e0d82651ca7cfcdcad8b1cef5a8ae07c6bd55..a343da58c6e3d066a2842019358f4ebc634467fe 100644 (file)
@@ -5108,12 +5108,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;
 }
@@ -5137,11 +5138,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;
 }