From: Lennart Poettering Date: Thu, 25 Oct 2018 11:57:44 +0000 (+0200) Subject: tmpfiles: fix minor memory leak on error path X-Git-Tag: v240~265^2~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ccd114f0f9d6bf9b11e5efc0127f7345f98356be;p=thirdparty%2Fsystemd.git tmpfiles: fix minor memory leak on error path --- diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c index 67060e57c11..cc5cbc382f0 100644 --- a/src/tmpfiles/tmpfiles.c +++ b/src/tmpfiles/tmpfiles.c @@ -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))