Blob Blame Raw
From 5a27f883fb60e520839a96d2e939bfcb4ad19edb Mon Sep 17 00:00:00 2001
From: Lukas Nykryn <lnykryn@redhat.com>
Date: Tue, 14 Jan 2014 15:40:16 +0100
Subject: [PATCH] coredumpctl: in case of error free pattern after print

(cherry picked from commit cf50a55277ee432e1217ad894afcbd9a664ff96c)
(cherry picked from commit e3d3ab46502d06d9e266cff638d78b05ecee8957)
---
 src/journal/coredumpctl.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/journal/coredumpctl.c b/src/journal/coredumpctl.c
index 5652c2f91a..8d3370c103 100644
--- a/src/journal/coredumpctl.c
+++ b/src/journal/coredumpctl.c
@@ -125,10 +125,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;
         }