util: Use glib memory functions in virErrorCopyNew

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Tim Wiederhake 2020-09-14 10:01:49 +02:00 committed by Ján Tomko
parent 4b53ce9fa7
commit fe0d57e160

View File

@ -223,14 +223,8 @@ virCopyError(virErrorPtr from,
virErrorPtr
virErrorCopyNew(virErrorPtr err)
{
virErrorPtr ret;
if (VIR_ALLOC_QUIET(ret) < 0)
return NULL;
if (virCopyError(err, ret) < 0)
VIR_FREE(ret);
virErrorPtr ret = g_new0(virError, 1);
virCopyError(err, ret);
return ret;
}