]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
tmpfiles: fix minor memory leak on error path
authorLennart Poettering <lennart@poettering.net>
Thu, 25 Oct 2018 11:57:44 +0000 (13:57 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 8 Nov 2018 08:52:16 +0000 (09:52 +0100)
src/tmpfiles/tmpfiles.c

index 67060e57c113fc88d5439db540735f0f88c6d292..cc5cbc382f066bd91e8a793cc98c7abe6449f3d1 100644 (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))