From 5ed2ed870826716557f6cf5e236f044f1ccdd49d Mon Sep 17 00:00:00 2001 From: Michal Privoznik Date: Thu, 13 Mar 2025 13:02:33 +0100 Subject: [PATCH] ch: Unref @cfg in virCHProcessStop() 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 Reviewed-by: Peter Krempa --- 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.47.2