qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio

qga: Plug unlikely memory leak in guest-set-memory-blocks

transfer_memory_block() leaks an Error object when reading file
/sys/devices/system/memory/memory<INDEX>/state fails with errno other
than ENOENT, and @sys2memblk is false, i.e. when the state file exists
but cannot be read (seems quite unlikely), and this is
guest-set-memory-blocks, not guest-get-memory-blocks.

Plug the leak.

Fixes: bd240fca42d5f072fb758a71720d9de9990ac553
Cc: Michael Roth <mdroth@linux.vnet.ibm.com>
Cc: Hailiang Zhang <zhang.zhanghailiang@huawei.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
Message-Id: <20200630090351.1247703-9-armbru@redhat.com>

+1
+1
qga/commands-posix.c
··· 2421 2421 if (sys2memblk) { 2422 2422 error_propagate(errp, local_err); 2423 2423 } else { 2424 + error_free(local_err); 2424 2425 result->response = 2425 2426 GUEST_MEMORY_BLOCK_RESPONSE_TYPE_OPERATION_FAILED; 2426 2427 }