Shutdown of virtlogd prints:
(process:54742): GLib-CRITICAL **: 11:00:40.873: g_regex_unref: assertion 'regex !=
NULL' failed
Use g_clear_pointer instead which prevents it in the NULL case.
Fixes: 69eeef5dfbf
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
src/logging/log_cleaner.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/logging/log_cleaner.c b/src/logging/log_cleaner.c
index bb8f719f1b..38f818f177 100644
--- a/src/logging/log_cleaner.c
+++ b/src/logging/log_cleaner.c
@@ -264,6 +264,5 @@ virLogCleanerShutdown(virLogHandler *handler)
handler->cleanup_log_timer = -1;
}
- g_regex_unref(log_regex);
- log_regex = NULL;
+ g_clear_pointer(&log_regex, g_regex_unref);
}
--
2.39.1