aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2021-08-10 09:42:06 +0100
committerPeter Maydell <peter.maydell@linaro.org>2021-08-10 09:42:06 +0100
commit1f3afa5da2be7469655e88611406226c6c6eb148 (patch)
tree2b010e54f719ef8c0a219a77e05a8083749c5838
parente0d24696b9d9d78d621e3dedfcb3d2c094bdd8a3 (diff)
parent057489dd1586612b99b4b98d211bf7f0a9d6f0e4 (diff)
downloadqemu-1f3afa5da2be7469655e88611406226c6c6eb148.zip
qemu-1f3afa5da2be7469655e88611406226c6c6eb148.tar.gz
qemu-1f3afa5da2be7469655e88611406226c6c6eb148.tar.bz2
Merge remote-tracking branch 'remotes/mdroth/tags/qga-pull-2021-08-09-tag' into staging
qemu-ga patch queue for hard-freeze * fix memory leak in guest_exec # gpg: Signature made Tue 10 Aug 2021 02:25:43 BST # gpg: using RSA key CEACC9E15534EBABB82D3FA03353C9CEF108B584 # gpg: Good signature from "Michael Roth <flukshun@gmail.com>" [full] # gpg: aka "Michael Roth <mdroth@utexas.edu>" [full] # gpg: aka "Michael Roth <mdroth@linux.vnet.ibm.com>" [full] # Primary key fingerprint: CEAC C9E1 5534 EBAB B82D 3FA0 3353 C9CE F108 B584 * remotes/mdroth/tags/qga-pull-2021-08-09-tag: qga: fix leak of base64 decoded data on command error Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rw-r--r--qga/commands.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/qga/commands.c b/qga/commands.c
index a6491d2..80501e4 100644
--- a/qga/commands.c
+++ b/qga/commands.c
@@ -402,7 +402,7 @@ GuestExec *qmp_guest_exec(const char *path,
GIOChannel *in_ch, *out_ch, *err_ch;
GSpawnFlags flags;
bool has_output = (has_capture_output && capture_output);
- uint8_t *input = NULL;
+ g_autofree uint8_t *input = NULL;
size_t ninput = 0;
arglist.value = (char *)path;
@@ -441,7 +441,7 @@ GuestExec *qmp_guest_exec(const char *path,
g_child_watch_add(pid, guest_exec_child_watch, gei);
if (has_input_data) {
- gei->in.data = input;
+ gei->in.data = g_steal_pointer(&input);
gei->in.size = ninput;
#ifdef G_OS_WIN32
in_ch = g_io_channel_win32_new_fd(in_fd);