richardphibel / rpms / systemd

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