diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2013-07-16 14:45:28 -0400 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2013-07-16 22:41:47 -0400 |
commit | 4ad16808c02e3eb6c1ec8500b3d086cc28e9b75a (patch) | |
tree | 64d0d5fb4bb0905217ba4e1af3e4958dff64926f /src/journal/journalctl.c | |
parent | 248fc619b5e3e24d78f171f95b85916eee7987bd (diff) |
journalctl,systemctl: fix tiny memleak
Diffstat (limited to 'src/journal/journalctl.c')
-rw-r--r-- | src/journal/journalctl.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c index 7415abc74f..7099706696 100644 --- a/src/journal/journalctl.c +++ b/src/journal/journalctl.c @@ -1408,7 +1408,12 @@ int main(int argc, char *argv[]) { if (r < 0) return EXIT_FAILURE; - log_debug("Journal filter: %s", j->level0 ? journal_make_match_string(j) : "none"); + 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); + } if (arg_field) { const void *data; |