mirror of
https://github.com/systemd/systemd.git
synced 2024-10-28 11:55:44 +03:00
Revert "Revert "coredumpctl: in case of error free pattern after print""
In the case of the error set_consume will free the pointer 'pattern'
which is later used in log_error. Either we should stop priniting that
or use simple set_put and free pattern manually.
This reverts commit ece6b8fd5b
.
This commit is contained in:
parent
3bedba4ae1
commit
1b2457e16d
@ -126,10 +126,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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user