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.
This commit is contained in:
Cole Robinson 2010-02-16 13:07:31 -05:00
parent 372a7f45c5
commit bf6789d913

View File

@ -304,7 +304,7 @@ int
virSetError(virErrorPtr newerr)
{
virErrorPtr err;
err = virGetLastError();
err = virLastErrorObject();
if (!err)
return -1;