mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-03-12 08:58:20 +03:00
sd-journal: free incomplete match on failure
This commit is contained in:
parent
a9c97bbbfb
commit
418cce628c
@ -233,7 +233,7 @@ static void match_free_if_empty(Match *m) {
|
||||
}
|
||||
|
||||
_public_ int sd_journal_add_match(sd_journal *j, const void *data, size_t size) {
|
||||
Match *l3, *l4, *add_here = NULL, *m;
|
||||
Match *l3, *l4, *add_here = NULL, *m = NULL;
|
||||
uint64_t hash;
|
||||
|
||||
assert_return(j, -EINVAL);
|
||||
@ -322,6 +322,7 @@ _public_ int sd_journal_add_match(sd_journal *j, const void *data, size_t size)
|
||||
return 0;
|
||||
|
||||
fail:
|
||||
match_free(m);
|
||||
match_free_if_empty(add_here);
|
||||
match_free_if_empty(j->level2);
|
||||
match_free_if_empty(j->level1);
|
||||
|
Loading…
x
Reference in New Issue
Block a user