coredumpctl: in case of error free pattern after print

(cherry picked from commit cf50a55277)
(cherry picked from commit e3d3ab4650)
This commit is contained in:
Lukas Nykryn
2014-07-22 23:03:33 -04:00
committed by Zbigniew Jędrzejewski-Szmek
parent a739675c3c
commit 5a27f883fb
+2 -1
View File
@@ -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;
}