diff options
author | Philippe De Swert <philippedeswert@gmail.com> | 2014-09-10 12:20:39 +0300 |
---|---|---|
committer | David Herrmann <dh.herrmann@gmail.com> | 2014-09-11 17:13:59 +0200 |
commit | 48d4c7468fb5003ae45ac834de1ca85624cdd56e (patch) | |
tree | 80c019d1815a8b588d6b62fa276d45d6fa3c37fa /src/journal/coredumpctl.c | |
parent | fd989a0bc999d79719408ac28b126d9c9016bcb5 (diff) |
journal: do not dereference already freed patterns
In case set_consume goes wrong, the pattern name has already been
freed. So we do not try to print it in the logs, assuming the pattern
addition print will be printed just before the failure anyway. Found
with coverity. Fixes: CID#1237798
Diffstat (limited to 'src/journal/coredumpctl.c')
-rw-r--r-- | src/journal/coredumpctl.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/journal/coredumpctl.c b/src/journal/coredumpctl.c index f5cf85a765..34dcae87c0 100644 --- a/src/journal/coredumpctl.c +++ b/src/journal/coredumpctl.c @@ -110,8 +110,7 @@ static int add_match(Set *set, const char *match) { log_debug("Adding pattern: %s", pattern); r = set_consume(set, pattern); if (r < 0) { - log_error("Failed to add pattern '%s': %s", - pattern, strerror(-r)); + log_error("Failed to add pattern: %s", strerror(-r)); goto fail; } |