sd-journal: free incomplete match on failure
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user