From: Richard W.M. Jones Date: Tue, 23 Aug 2011 17:43:24 +0000 (+0100) Subject: qemu detection: Free up previous qemu help/version strings if they exist. X-Git-Tag: 1.12.5~19 X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=e1aacceb571cff274885fd4cbfbccfe74454d224;p=libguestfs.git qemu detection: Free up previous qemu help/version strings if they exist. (cherry picked from commit 2ace9be4cd69e84cd88e5b0fd74de861a4973c91) --- diff --git a/src/launch.c b/src/launch.c index db76885..cb0f637 100644 --- a/src/launch.c +++ b/src/launch.c @@ -1071,6 +1071,11 @@ test_qemu (guestfs_h *g) char cmd[1024]; FILE *fp; + free (g->qemu_help); + g->qemu_help = NULL; + free (g->qemu_version); + g->qemu_version = NULL; + snprintf (cmd, sizeof cmd, "LC_ALL=C '%s' -nographic -help", g->qemu); /* qemu -help should always work (qemu -version OTOH wasn't