summaryrefslogtreecommitdiff
path: root/src/journal/sd-journal.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2016-10-16 18:28:30 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2016-10-16 23:35:39 -0400
commit6b430fdb7c0c2c52ea69a7d56f23d739218b13d0 (patch)
tree5ddb3975a8146fbee7c114e41a967e2abf9caa11 /src/journal/sd-journal.c
parentd7604756ca5888350d5ed4ab6867baa967b24299 (diff)
tree-wide: use mfree more
Diffstat (limited to 'src/journal/sd-journal.c')
-rw-r--r--src/journal/sd-journal.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/journal/sd-journal.c b/src/journal/sd-journal.c
index 98c8a47afe..f2f8546086 100644
--- a/src/journal/sd-journal.c
+++ b/src/journal/sd-journal.c
@@ -387,7 +387,7 @@ _public_ int sd_journal_add_disjunction(sd_journal *j) {
}
static char *match_make_string(Match *m) {
- char *p, *r;
+ char *p = NULL, *r;
Match *i;
bool enclose = false;
@@ -397,15 +397,12 @@ static char *match_make_string(Match *m) {
if (m->type == MATCH_DISCRETE)
return strndup(m->data, m->size);
- p = NULL;
LIST_FOREACH(matches, i, m->matches) {
char *t, *k;
t = match_make_string(i);
- if (!t) {
- free(p);
- return NULL;
- }
+ if (!t)
+ return mfree(p);
if (p) {
k = strjoin(p, m->type == MATCH_OR_TERM ? " OR " : " AND ", t, NULL);