chiark / gitweb /
Revert "coredumpctl: in case of error free pattern after print"
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 14 Jan 2014 14:49:10 +0000 (09:49 -0500)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 14 Jan 2014 14:49:30 +0000 (09:49 -0500)
This reverts commit cf50a55277ee432e1217ad894afcbd9a664ff96c.

set_consume frees on error.

src/journal/coredumpctl.c

index e564ab6..70eaf0e 100644 (file)
@@ -126,11 +126,10 @@ static int add_match(Set *set, const char *match) {
                 goto fail;
 
         log_debug("Adding pattern: %s", pattern);
-        r = set_put(set, pattern);
+        r = set_consume(set, pattern);
         if (r < 0) {
                 log_error("Failed to add pattern '%s': %s",
                           pattern, strerror(-r));
-                free(pattern);
                 goto fail;
         }