]> git.proxmox.com Git - mirror_qemu.git/commitdiff
tests: fix postcopy-test leaks
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Mon, 18 Jul 2016 12:24:09 +0000 (16:24 +0400)
committerMarc-André Lureau <marcandre.lureau@redhat.com>
Thu, 8 Sep 2016 14:05:22 +0000 (18:05 +0400)
A few strings are allocated and never freed.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
tests/postcopy-test.c

index bf4e579554a3f0bda8afac6098c857df0da928c4..41ed1a976fec90ca0b3d2b7f4e1a6b2564a2e793 100644 (file)
@@ -176,6 +176,7 @@ static void wait_for_serial(const char *side)
     int started = (strcmp(side, "src_serial") == 0 &&
                    strcmp(arch, "ppc64") == 0) ? 0 : 1;
 
+    g_free(serialpath);
     do {
         int readvalue = fgetc(serialfile);
 
@@ -203,7 +204,6 @@ static void wait_for_serial(const char *side)
         case 'B':
             /* It's alive! */
             fclose(serialfile);
-            g_free(serialpath);
             return;
 
         case EOF:
@@ -350,6 +350,7 @@ static void cleanup(const char *filename)
     char *path = g_strdup_printf("%s/%s", tmpfs, filename);
 
     unlink(path);
+    g_free(path);
 }
 
 static void test_migrate(void)
@@ -394,6 +395,8 @@ static void test_migrate(void)
         g_assert_not_reached();
     }
 
+    g_free(bootpath);
+
     from = qtest_start(cmd_src);
     g_free(cmd_src);