From 4ad16808c02e3eb6c1ec8500b3d086cc28e9b75a Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Tue, 16 Jul 2013 14:45:28 -0400 Subject: journalctl,systemctl: fix tiny memleak --- src/shared/logs-show.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/shared') diff --git a/src/shared/logs-show.c b/src/shared/logs-show.c index 8dc11bb7fd..ea4746879b 100644 --- a/src/shared/logs-show.c +++ b/src/shared/logs-show.c @@ -1059,7 +1059,12 @@ int show_journal_by_unit( if (r < 0) return r; - log_debug("Journal filter: %s", journal_make_match_string(j)); + if (_unlikely_(log_get_max_level() >= LOG_PRI(LOG_DEBUG))) { + _cleanup_free_ char *filter; + + filter = journal_make_match_string(j); + log_debug("Journal filter: %s", filter); + } r = show_journal(f, j, mode, n_columns, not_before, how_many, flags); if (r < 0) -- cgit v1.2.3-54-g00ecf