Skip to content

Commit 1f3afa5

Browse files
committed
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 <[email protected]>" [full] # gpg: aka "Michael Roth <[email protected]>" [full] # gpg: aka "Michael Roth <[email protected]>" [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 <[email protected]>
2 parents e0d2469 + 057489d commit 1f3afa5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

qga/commands.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ GuestExec *qmp_guest_exec(const char *path,
402402
GIOChannel *in_ch, *out_ch, *err_ch;
403403
GSpawnFlags flags;
404404
bool has_output = (has_capture_output && capture_output);
405-
uint8_t *input = NULL;
405+
g_autofree uint8_t *input = NULL;
406406
size_t ninput = 0;
407407

408408
arglist.value = (char *)path;
@@ -441,7 +441,7 @@ GuestExec *qmp_guest_exec(const char *path,
441441
g_child_watch_add(pid, guest_exec_child_watch, gei);
442442

443443
if (has_input_data) {
444-
gei->in.data = input;
444+
gei->in.data = g_steal_pointer(&input);
445445
gei->in.size = ninput;
446446
#ifdef G_OS_WIN32
447447
in_ch = g_io_channel_win32_new_fd(in_fd);

0 commit comments

Comments
 (0)