mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
virLogCleanerShutdown: Don't call g_regex_unref on NULL regex
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@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
parent
b3f8e072fe
commit
8c8eff610a
@ -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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user