[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 4/4] qga: Fix a memory leak
From: |
Markus Armbruster |
Subject: |
[PULL 4/4] qga: Fix a memory leak |
Date: |
Mon, 9 Mar 2020 13:46:16 +0100 |
From: Philippe Mathieu-Daudé <address@hidden>
The string returned by g_win32_error_message() has to be
deallocated with g_free().
Reviewed-by: Marc-André Lureau <address@hidden>
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>
---
qga/channel-win32.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/qga/channel-win32.c b/qga/channel-win32.c
index 99648c95b6..4f04868a76 100644
--- a/qga/channel-win32.c
+++ b/qga/channel-win32.c
@@ -302,8 +302,8 @@ static gboolean ga_channel_open(GAChannel *c,
GAChannelMethod method,
OPEN_EXISTING,
FILE_FLAG_NO_BUFFERING | FILE_FLAG_OVERLAPPED,
NULL);
if (c->handle == INVALID_HANDLE_VALUE) {
- g_critical("error opening path %s: %s", newpath,
- g_win32_error_message(GetLastError()));
+ g_autofree gchar *emsg = g_win32_error_message(GetLastError());
+ g_critical("error opening path %s: %s", newpath, emsg);
return false;
}
--
2.21.1