mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-14 00:06:24 +01:00
W32 gstdio: don't close fd handle
If a handle was obtained from a fd that we got from up the stack, we shouldn't call CloseHandle() on it in case of an error. This is a bug. Luckily, it happens only on the error codepath, so, hopefully, no one had hit it yet.
This commit is contained in:
parent
3ba2f8333b
commit
b33a454a42
@ -199,7 +199,8 @@ _g_win32_stat_utf16_no_trailing_slashes (const gunichar2 *filename,
|
||||
|
||||
if (!succeeded_so_far)
|
||||
{
|
||||
CloseHandle (file_handle);
|
||||
if (fd < 0)
|
||||
CloseHandle (file_handle);
|
||||
errno = w32_error_to_errno (error_code);
|
||||
return -1;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user