]> git.ipfire.org Git - thirdparty/systemd.git/commit
shared: fix a memory leak 7559/head
authorEvgeny Vereshchagin <evvers@ya.ru>
Wed, 6 Dec 2017 19:12:05 +0000 (19:12 +0000)
committerEvgeny Vereshchagin <evvers@ya.ru>
Wed, 6 Dec 2017 19:31:28 +0000 (19:31 +0000)
commite62d3165612c442c479d38678b44cac1d26d29f7
tree02c9f1e1661cdec35fc354c430a8f2e6efad0bfc
parent59ca366cdde8e86ef5d8d536ed1220ba38e26b35
shared: fix a memory leak

```
$ ./src/test/test-systemd-tmpfiles.py valgrind --leak-check=full --error-exitcode=1 ./build/systemd-tmpfiles
...
Running valgrind --leak-check=full --error-exitcode=1 ./build/systemd-tmpfiles on 'w /unresolved/argument - - - - "%Y"'
...
[<stdin>:1] Failed to substitute specifiers in argument: Invalid slot
...
==22602== 5 bytes in 1 blocks are definitely lost in loss record 1 of 2
==22602==    at 0x4C2DB8F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==22602==    by 0x4ECA7D4: malloc_multiply (alloc-util.h:74)
==22602==    by 0x4ECA909: specifier_printf (specifier.c:59)
==22602==    by 0x113490: specifier_expansion_from_arg (tmpfiles.c:1923)
==22602==    by 0x1144E7: parse_line (tmpfiles.c:2159)
==22602==    by 0x11551C: read_config_file (tmpfiles.c:2425)
==22602==    by 0x115AB0: main (tmpfiles.c:2529)
```
src/shared/specifier.c