chiark / gitweb /
test-path-util: fix a leak
authorThomas Hindoe Paaboel Andersen <phomes@gmail.com>
Wed, 3 Dec 2014 23:05:20 +0000 (00:05 +0100)
committerThomas Hindoe Paaboel Andersen <phomes@gmail.com>
Wed, 3 Dec 2014 23:13:10 +0000 (00:13 +0100)
src/test/test-path-util.c

index 4ebbfa9a768b3cc9400ebdd02af8d693cb7ab91e..58b456a29183da7116d40475cf9a0f00b80912b1 100644 (file)
@@ -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) {