Blob Blame History Raw
From 7f277fb1bbb480fdd616d0ac785a6e08b764b644 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Wed, 6 Apr 2016 10:42:21 +0100
Subject: [PATCH] tests/qemu: Don't leak backend variable in
 boot-analysis/boot-benchmark programs.

(cherry picked from commit 0008d794cf00b07842bc5403b53684e2bad5053a)
---
 tests/qemu/boot-analysis-utils.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tests/qemu/boot-analysis-utils.c b/tests/qemu/boot-analysis-utils.c
index bcd470e..4ed2d48 100644
--- a/tests/qemu/boot-analysis-utils.c
+++ b/tests/qemu/boot-analysis-utils.c
@@ -53,6 +53,7 @@ test_info (guestfs_h *g, int nr_test_passes)
 {
   const char *qemu = guestfs_get_hv (g);
   CLEANUP_FREE char *cmd = NULL;
+  CLEANUP_FREE char *backend = NULL;
 
   /* Related to the test program. */
   printf ("test version: %s %s\n", PACKAGE_NAME, PACKAGE_VERSION_FULL);
@@ -67,7 +68,8 @@ test_info (guestfs_h *g, int nr_test_passes)
   ignore_value (system ("perl -n -e 'if (/^model name.*: (.*)/) { print \"$1\\n\"; exit }' /proc/cpuinfo"));
 
   /* Related to qemu. */
-  printf ("     backend: %s\n", guestfs_get_backend (g));
+  backend = guestfs_get_backend (g);
+  printf ("     backend: %s\n", backend);
   printf ("        qemu: %s\n", qemu);
   printf ("qemu version: ");
   fflush (stdout);
-- 
2.7.4