]> xenbits.xensource.com Git - libvirt.git/commit
virSecretLoad: Simplify cleanup path
authorMichal Privoznik <mprivozn@redhat.com>
Mon, 16 Oct 2023 08:03:28 +0000 (10:03 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 17 Oct 2023 06:32:24 +0000 (08:32 +0200)
commit2a88b51edffedc089f60f7adaa79dd95f5eace55
tree59223fd1560aac52953f192b87d170cd1f21d61e
parent7cb31974ec33a1be3ae6d9765f4b2629d9b4d2c2
virSecretLoad: Simplify cleanup path

When loading a secret value fails, the control jumps over to the
'cleanup' label where explicit call to virSecretDefFree()
happens. This is unnecessary as the corresponding variable can be
declared with g_autoptr() after which all error paths can just
return NULL instantly.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/conf/virsecretobj.c