From bf6789d913a5edb029af8fe959c0d54ede2a2719 Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Tue, 16 Feb 2010 13:07:31 -0500 Subject: [PATCH] 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. --- src/util/virterror.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- GitLab