[libvirt PATCH 06/21] util: Use glib memory functions in virSaveLastError

Tim Wiederhake twiederh at redhat.com
Fri Sep 11 11:42:03 UTC 2020


Signed-off-by: Tim Wiederhake <twiederh at redhat.com>
---
 src/util/virerror.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/util/virerror.c b/src/util/virerror.c
index 99a0855b51..df4205043a 100644
--- a/src/util/virerror.c
+++ b/src/util/virerror.c
@@ -405,8 +405,7 @@ virSaveLastError(void)
     virErrorPtr to;
     int saved_errno = errno;
 
-    if (VIR_ALLOC_QUIET(to) < 0)
-        return NULL;
+    to = g_new0(virError, 1);
 
     virCopyLastError(to);
     errno = saved_errno;
-- 
2.26.2




More information about the libvir-list mailing list