]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
basic/fileio: Fix memory leak if READ_FULL_FILE_SECURE flag is used
authorBenjamin Robin <dev@benjarobin.fr>
Sun, 14 Apr 2019 15:21:27 +0000 (17:21 +0200)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 15 Apr 2019 04:54:19 +0000 (13:54 +0900)
The memory leak introduced in #12223 (15f8f02)

src/basic/fileio.c

index 2cec054610012001ce19a94e45165a67f1d08778..16034fb9e8a2d08a7813c6728ced5c86afc9ed95 100644 (file)
@@ -359,6 +359,7 @@ int read_full_stream_full(
                         }
                         memcpy_safe(t, buf, n);
                         explicit_bzero_safe(buf, n);
+                        buf = mfree(buf);
                 } else {
                         t = realloc(buf, n_next + 1);
                         if (!t)