[PATCH 3/3] virLogCleanerShutdown: Don't call g_regex_unref on NULL regex

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

 



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@xxxxxxxxxx>
---
 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




[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