Do not access 'mon' after unref'ing it.
Signed-off-by: Ján Tomko <jtomko(a)redhat.com>
---
src/ch/ch_monitor.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/ch/ch_monitor.c b/src/ch/ch_monitor.c
index 1648d05017..0f8752d1ed 100644
--- a/src/ch/ch_monitor.c
+++ b/src/ch/ch_monitor.c
@@ -543,9 +543,8 @@ void virCHMonitorClose(virCHMonitor *mon)
g_free(mon->socketpath);
}
+ virObjectUnref(mon->vm);
virObjectUnref(mon);
- if (mon->vm)
- virObjectUnref(mon->vm);
}
static int
--
2.31.1