test-fs-util: fix memleak
Fixes: ``` $ ./libtool --mode=execute valgrind --leak-check=full ./test-fs-util ... ==22871== ==22871== 27 bytes in 1 blocks are definitely lost in loss record 1 of 1 ==22871== at 0x4C2FC47: realloc (vg_replace_malloc.c:785) ==22871== by 0x4E86D05: strextend (string-util.c:726) ==22871== by 0x4E8F347: chase_symlinks (fs-util.c:712) ==22871== by 0x109EBF: test_chase_symlinks (test-fs-util.c:75) ==22871== by 0x10C381: main (test-fs-util.c:305) ==22871== ``` Closes #4888
This commit is contained in:
@@ -78,6 +78,7 @@ static void test_chase_symlinks(void) {
|
||||
|
||||
assert_se(mkdir(q, 0700) >= 0);
|
||||
|
||||
result = mfree(result);
|
||||
r = chase_symlinks(p, temp, 0, &result);
|
||||
assert_se(r > 0);
|
||||
assert_se(path_equal(result, q));
|
||||
|
||||
Reference in New Issue
Block a user