chiark / gitweb /
test-path-util,test-sched-prio: uninitialize manager to appease valgrind
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 12 Jul 2013 12:04:39 +0000 (08:04 -0400)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 12 Jul 2013 17:24:06 +0000 (13:24 -0400)
src/test/test-path-util.c
src/test/test-sched-prio.c
src/test/test-unit-name.c

index 127e178..f396b32 100644 (file)
@@ -56,7 +56,7 @@ static void test_path(void) {
         assert_se(streq(path_get_file_name("file.../"), ""));
 
 #define test_parent(x, y) {                                \
-                char *z;                                   \
+                char _cleanup_free_ *z = NULL;             \
                 int r = path_get_parent(x, &z);            \
                 printf("expected: %s\n", y ? y : "error"); \
                 printf("actual: %s\n", r<0 ? "error" : z); \
index 7af7407..509c75f 100644 (file)
@@ -88,5 +88,7 @@ int main(int argc, char *argv[]) {
         assert_se(ser->exec_context.cpu_sched_policy == SCHED_RR);
         assert_se(ser->exec_context.cpu_sched_priority == 99);
 
+        manager_free(m);
+
         return EXIT_SUCCESS;
 }
index 93bf28a..2fa0294 100644 (file)
@@ -190,6 +190,8 @@ static int test_unit_printf(void) {
         expect(u2, "%H", host);
         expect(u2, "%t", "/run/user/*");
 
+        manager_free(m);
+
         return 0;
 }