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

qga: Fix a memory leak

The string returned by g_win32_error_message() has to be
deallocated with g_free().

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20200228100726.8414-5-philmd@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>

authored by

Philippe Mathieu-Daudé and committed by
Markus Armbruster
d1eddab8 672db778

+2 -2
+2 -2
qga/channel-win32.c
··· 302 302 OPEN_EXISTING, 303 303 FILE_FLAG_NO_BUFFERING | FILE_FLAG_OVERLAPPED, NULL); 304 304 if (c->handle == INVALID_HANDLE_VALUE) { 305 - g_critical("error opening path %s: %s", newpath, 306 - g_win32_error_message(GetLastError())); 305 + g_autofree gchar *emsg = g_win32_error_message(GetLastError()); 306 + g_critical("error opening path %s: %s", newpath, emsg); 307 307 return false; 308 308 } 309 309