]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virterror: Make SetError work if no previous error was set
authorCole Robinson <crobinso@redhat.com>
Tue, 16 Feb 2010 18:07:31 +0000 (13:07 -0500)
committerCole Robinson <crobinso@redhat.com>
Thu, 18 Feb 2010 14:23:04 +0000 (09:23 -0500)
virGetLastError returns NULL if no error has been set, not on
allocation error like virSetError assumed. Use virLastErrorObject
instead. This fixes virSetError when no error is currently stored.

src/util/virterror.c

index bbf5021374cceb0e138542e097874031ad283f32..cbd0ca8e878eb1b323fddea95b0fc789273028dc 100644 (file)
@@ -304,7 +304,7 @@ int
 virSetError(virErrorPtr newerr)
 {
     virErrorPtr err;
-    err = virGetLastError();
+    err = virLastErrorObject();
     if (!err)
         return -1;