ryantimwilson / rpms / systemd

Forked from rpms/systemd 2 months ago
Clone
572a44
From 70a0ba4546c69646ef7b220fb5e753416443d5b2 Mon Sep 17 00:00:00 2001
572a44
From: Lukas Nykryn <lnykryn@redhat.com>
572a44
Date: Tue, 14 Jan 2014 15:40:16 +0100
572a44
Subject: [PATCH] coredumpctl: in case of error free pattern after print
572a44
572a44
---
572a44
 src/journal/coredumpctl.c | 3 ++-
572a44
 1 file changed, 2 insertions(+), 1 deletion(-)
572a44
572a44
diff --git a/src/journal/coredumpctl.c b/src/journal/coredumpctl.c
572a44
index 75c96cc..356d03d 100644
572a44
--- a/src/journal/coredumpctl.c
572a44
+++ b/src/journal/coredumpctl.c
572a44
@@ -126,10 +126,11 @@ static int add_match(Set *set, const char *match) {
572a44
                 goto fail;
572a44
 
572a44
         log_debug("Adding pattern: %s", pattern);
572a44
-        r = set_consume(set, pattern);
572a44
+        r = set_put(set, pattern);
572a44
         if (r < 0) {
572a44
                 log_error("Failed to add pattern '%s': %s",
572a44
                           pattern, strerror(-r));
572a44
+                free(pattern);
572a44
                 goto fail;
572a44
         }
572a44