]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
ch: Unref @cfg in virCHProcessStop()
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 13 Mar 2025 12:02:33 +0000 (13:02 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 13 Mar 2025 14:51:15 +0000 (15:51 +0100)
At the beginning of virCHProcessStop() the ref to driver config
is obtained (via virCHDriverGetConfig()), but corresponding unref
call is lacking. Use g_autoptr() to make sure the config is
unrefed always.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
src/ch/ch_process.c

index cbf98faaf06d1a00c0e59b3318b86db5e3846031..79f5990cc171364f941e943022e21cf8cf296b43 100644 (file)
@@ -997,11 +997,11 @@ virCHProcessStop(virCHDriver *driver,
                  virDomainObj *vm,
                  virDomainShutoffReason reason)
 {
+    g_autoptr(virCHDriverConfig) cfg = virCHDriverGetConfig(driver);
     int ret;
     int retries = 0;
     unsigned int hostdev_flags = VIR_HOSTDEV_SP_PCI;
     virCHDomainObjPrivate *priv = vm->privateData;
-    virCHDriverConfig *cfg = virCHDriverGetConfig(driver);
     virDomainDef *def = vm->def;
     size_t i;