Skip to content
Snippets Groups Projects
Commit 057489dd authored by Daniel P. Berrangé's avatar Daniel P. Berrangé Committed by Michael Roth
Browse files

qga: fix leak of base64 decoded data on command error


If the guest command fails to be spawned, then we would leak the decoded
base64 input used for the command's stdin feed.

Signed-off-by: default avatarDaniel P. Berrangé <berrange@redhat.com>
Reviewed-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: default avatarMichael Roth <michael.roth@amd.com>
parent dee64246
No related branches found
No related tags found
No related merge requests found
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment