X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Ftest%2Ftest-path-util.c;h=11aa52aaed51b7e5d307c5fc7a8bcf5ffc2a03bf;hb=b6e676ce41508e2aeea22202fc8f234126177f52;hp=4ebbfa9a768b3cc9400ebdd02af8d693cb7ab91e;hpb=b63bd1090bf6ce79b6757c3f8f4172a367854577;p=elogind.git diff --git a/src/test/test-path-util.c b/src/test/test-path-util.c index 4ebbfa9a7..11aa52aae 100644 --- a/src/test/test-path-util.c +++ b/src/test/test-path-util.c @@ -109,6 +109,8 @@ static void test_find_binary(const char *self, bool local) { assert_se(find_binary("/some/dir/xxxx-xxxx", local, &p) == (local ? -ENOENT : 0)); + if (!local) + free(p); } static void test_prefixes(void) { @@ -174,13 +176,13 @@ static void test_path_join(void) { test_join("/root", "/a/b", "/c", "/root/a/b/c"); test_join("/root", "a/b", "c", "/root/a/b/c"); test_join("/root", "/a/b", "c", "/root/a/b/c"); - test_join("/root", "/", "c", "/root//c"); + test_join("/root", "/", "c", "/root/c"); test_join("/root", "/", NULL, "/root/"); test_join(NULL, "/a/b", "/c", "/a/b/c"); test_join(NULL, "a/b", "c", "a/b/c"); test_join(NULL, "/a/b", "c", "/a/b/c"); - test_join(NULL, "/", "c", "//c"); + test_join(NULL, "/", "c", "/c"); test_join(NULL, "/", NULL, "/"); }