mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 13:45:38 +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: 69eeef5dfb
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…
Reference in New Issue
Block a user