Re: [PATCH] qga: fix a memory leak in qmp_guest_exec_status()

2021-06-30 Thread Marc-André Lureau
Hi On Wed, Jun 30, 2021 at 11:42 AM Yi Wang wrote: > From: Wang Yechao > > The $GuestExecInfo.out.data is alloced in guest_exec_output_watch(), > and the buffer size is $GuestExecInfo.out.size. We should free the > $GuestExecInfo.out.data judge by the size, not length. Because the > $GuestExecI

[PATCH] qga: fix a memory leak in qmp_guest_exec_status()

2021-06-30 Thread Yi Wang
From: Wang Yechao The $GuestExecInfo.out.data is alloced in guest_exec_output_watch(), and the buffer size is $GuestExecInfo.out.size. We should free the $GuestExecInfo.out.data judge by the size, not length. Because the $GuestExecInfo.out.length maybe zero in some case. $GuestExecInfo.err.data