mrc0mmand / rpms / libguestfs

Forked from rpms/libguestfs 3 years ago
Clone

Blame SOURCES/0057-tests-qemu-Don-t-leak-backend-variable-in-boot-analy.patch

e76f14
From 7f277fb1bbb480fdd616d0ac785a6e08b764b644 Mon Sep 17 00:00:00 2001
e76f14
From: "Richard W.M. Jones" <rjones@redhat.com>
e76f14
Date: Wed, 6 Apr 2016 10:42:21 +0100
e76f14
Subject: [PATCH] tests/qemu: Don't leak backend variable in
e76f14
 boot-analysis/boot-benchmark programs.
e76f14
e76f14
(cherry picked from commit 0008d794cf00b07842bc5403b53684e2bad5053a)
e76f14
---
e76f14
 tests/qemu/boot-analysis-utils.c | 4 +++-
e76f14
 1 file changed, 3 insertions(+), 1 deletion(-)
e76f14
e76f14
diff --git a/tests/qemu/boot-analysis-utils.c b/tests/qemu/boot-analysis-utils.c
e76f14
index bcd470e..4ed2d48 100644
e76f14
--- a/tests/qemu/boot-analysis-utils.c
e76f14
+++ b/tests/qemu/boot-analysis-utils.c
e76f14
@@ -53,6 +53,7 @@ test_info (guestfs_h *g, int nr_test_passes)
e76f14
 {
e76f14
   const char *qemu = guestfs_get_hv (g);
e76f14
   CLEANUP_FREE char *cmd = NULL;
e76f14
+  CLEANUP_FREE char *backend = NULL;
e76f14
 
e76f14
   /* Related to the test program. */
e76f14
   printf ("test version: %s %s\n", PACKAGE_NAME, PACKAGE_VERSION_FULL);
e76f14
@@ -67,7 +68,8 @@ test_info (guestfs_h *g, int nr_test_passes)
e76f14
   ignore_value (system ("perl -n -e 'if (/^model name.*: (.*)/) { print \"$1\\n\"; exit }' /proc/cpuinfo"));
e76f14
 
e76f14
   /* Related to qemu. */
e76f14
-  printf ("     backend: %s\n", guestfs_get_backend (g));
e76f14
+  backend = guestfs_get_backend (g);
e76f14
+  printf ("     backend: %s\n", backend);
e76f14
   printf ("        qemu: %s\n", qemu);
e76f14
   printf ("qemu version: ");
e76f14
   fflush (stdout);
e76f14
-- 
e76f14
1.8.3.1
e76f14