chiark / gitweb /
journalctl,systemctl: fix tiny memleak
[elogind.git] / src / journal / journalctl.c
index 7415abc74f0160d4e73863d855f9f815263a4542..709970669685a8deb7e9a8b7764cab58190a9553 100644 (file)
@@ -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;