summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Nykryn <lnykryn@redhat.com>2014-01-15 12:46:44 +0100
committerLukas Nykryn <lnykryn@redhat.com>2014-01-15 12:46:44 +0100
commit1b2457e16dbbaa5e587c5e36d274a48c585d4840 (patch)
tree7978f6e31bcb66a90a4ca83dcb3dcdb1cc9d2cd5
parent3bedba4ae1237d0b7ff4543f9a5c6234d342d98f (diff)
Revert "Revert "coredumpctl: in case of error free pattern after print""
In the case of the error set_consume will free the pointer 'pattern' which is later used in log_error. Either we should stop priniting that or use simple set_put and free pattern manually. This reverts commit ece6b8fd5bbc1fee16f652e680e3033f2f3efc4a.
-rw-r--r--src/journal/coredumpctl.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/journal/coredumpctl.c b/src/journal/coredumpctl.c
index 70eaf0e64c..e564ab656c 100644
--- a/src/journal/coredumpctl.c
+++ b/src/journal/coredumpctl.c
@@ -126,10 +126,11 @@ static int add_match(Set *set, const char *match) {
goto fail;
log_debug("Adding pattern: %s", pattern);
- r = set_consume(set, pattern);
+ r = set_put(set, pattern);
if (r < 0) {
log_error("Failed to add pattern '%s': %s",
pattern, strerror(-r));
+ free(pattern);
goto fail;
}