Signed-off-by: Tim Wiederhake <twiederh(a)redhat.com>
---
src/util/virerror.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/src/util/virerror.c b/src/util/virerror.c
index 507a29f50f..4ba99defbb 100644
--- a/src/util/virerror.c
+++ b/src/util/virerror.c
@@ -223,15 +223,14 @@ virCopyError(virErrorPtr from,
virErrorPtr
virErrorCopyNew(virErrorPtr err)
{
- virErrorPtr ret;
+ g_autoptr(virError) ret = NULL;
- if (VIR_ALLOC_QUIET(ret) < 0)
- return NULL;
+ ret = g_new0(virError, 1);
if (virCopyError(err, ret) < 0)
- VIR_FREE(ret);
+ return NULL;
- return ret;
+ return g_steal_pointer(&ret);
}
--
2.26.2