mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 11:22:23 +00:00
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:
parent
372a7f45c5
commit
bf6789d913
@ -304,7 +304,7 @@ int
|
||||
virSetError(virErrorPtr newerr)
|
||||
{
|
||||
virErrorPtr err;
|
||||
err = virGetLastError();
|
||||
err = virLastErrorObject();
|
||||
if (!err)
|
||||
return -1;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user