tmpfiles: fix minor memory leak on error path

This commit is contained in:
Lennart Poettering 2018-10-25 13:57:44 +02:00
parent 81fa4479f8
commit ccd114f0f9
1 changed files with 3 additions and 1 deletions

View File

@ -2792,8 +2792,10 @@ static int parse_line(const char *fname, unsigned line, const char *buffer, bool
return log_oom();
r = ordered_hashmap_put(h, i.path, existing);
if (r < 0)
if (r < 0) {
free(existing);
return log_oom();
}
}
if (!GREEDY_REALLOC(existing->items, existing->allocated, existing->n_items + 1))