[PATCH 5/6] ch: Unref @cfg in virCHProcessStop()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 src/ch/ch_process.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/ch/ch_process.c b/src/ch/ch_process.c
index cbf98faaf0..79f5990cc1 100644
--- a/src/ch/ch_process.c
+++ b/src/ch/ch_process.c
@@ -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;
 
-- 
2.48.1




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux