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>
This commit is contained in:
parent
672db77892
commit
d1eddab86f
@ -302,8 +302,8 @@ static gboolean ga_channel_open(GAChannel *c, GAChannelMethod method,
|
|||||||
OPEN_EXISTING,
|
OPEN_EXISTING,
|
||||||
FILE_FLAG_NO_BUFFERING | FILE_FLAG_OVERLAPPED, NULL);
|
FILE_FLAG_NO_BUFFERING | FILE_FLAG_OVERLAPPED, NULL);
|
||||||
if (c->handle == INVALID_HANDLE_VALUE) {
|
if (c->handle == INVALID_HANDLE_VALUE) {
|
||||||
g_critical("error opening path %s: %s", newpath,
|
g_autofree gchar *emsg = g_win32_error_message(GetLastError());
|
||||||
g_win32_error_message(GetLastError()));
|
g_critical("error opening path %s: %s", newpath, emsg);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user