mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-09-09 09:14:57 +00:00
util: Use glib memory functions in virLastErrorObject
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:
parent
fe0d57e160
commit
7f1499b8c8
@ -235,10 +235,9 @@ virLastErrorObject(void)
|
|||||||
virErrorPtr err;
|
virErrorPtr err;
|
||||||
err = virThreadLocalGet(&virLastErr);
|
err = virThreadLocalGet(&virLastErr);
|
||||||
if (!err) {
|
if (!err) {
|
||||||
if (VIR_ALLOC_QUIET(err) < 0)
|
err = g_new0(virError, 1);
|
||||||
return NULL;
|
|
||||||
if (virThreadLocalSet(&virLastErr, err) < 0)
|
if (virThreadLocalSet(&virLastErr, err) < 0)
|
||||||
VIR_FREE(err);
|
g_clear_pointer(&err, g_free);
|
||||||
}
|
}
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user