]> git.ipfire.org Git - thirdparty/libvirt.git/commit
esx: use g_steal_pointer+g_autofree on return value
authorLaine Stump <laine@redhat.com>
Fri, 12 Feb 2021 19:21:36 +0000 (14:21 -0500)
committerLaine Stump <laine@redhat.com>
Tue, 16 Feb 2021 18:50:05 +0000 (13:50 -0500)
commit33d3ebff71f0e6dded1994d47ae30323af9d4330
tree83d2918fc8abad51e70809b4332a9c2c5405c4c6
parent443c79dd7f7d4051fc0084baaa6c56a55d2aace4
esx: use g_steal_pointer+g_autofree on return value

If we put the potential return string into the g_autofreed tmpResult,
and the move it to the returned "result" only as a final step ater, we
can avoid the need to explicitly VIR_FREE (or g_free) on failure.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/esx/esx_driver.c