From: Cole Robinson Date: Tue, 16 Feb 2010 18:07:31 +0000 (-0500) Subject: virterror: Make SetError work if no previous error was set X-Git-Tag: v0.7.7~134 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bf6789d913a5edb029af8fe959c0d54ede2a2719;p=thirdparty%2Flibvirt.git virterror: Make SetError work if no previous error was set 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. --- diff --git a/src/util/virterror.c b/src/util/virterror.c index bbf5021374..cbd0ca8e87 100644 --- a/src/util/virterror.c +++ b/src/util/virterror.c @@ -304,7 +304,7 @@ int virSetError(virErrorPtr newerr) { virErrorPtr err; - err = virGetLastError(); + err = virLastErrorObject(); if (!err) return -1;