mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-02-08 10:09:32 +08:00
Cygwin: check path_conv_handle for NULL before trying to dup it
path_conv_handle::dup calls DuplicateHandle unconditionally, but we only have a handle in some cases. Check handle for being non-NULL before calling DuplicateHandle. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
parent
762d6fd6dd
commit
518f0b8ef9
@ -105,9 +105,10 @@ public:
|
||||
}
|
||||
inline void dup (const path_conv_handle &pch)
|
||||
{
|
||||
if (!DuplicateHandle (GetCurrentProcess (), pch.handle (),
|
||||
GetCurrentProcess (), &hdl,
|
||||
0, TRUE, DUPLICATE_SAME_ACCESS))
|
||||
if (pch.handle ()
|
||||
&& !DuplicateHandle (GetCurrentProcess (), pch.handle (),
|
||||
GetCurrentProcess (), &hdl,
|
||||
0, TRUE, DUPLICATE_SAME_ACCESS))
|
||||
hdl = NULL;
|
||||
}
|
||||
inline HANDLE handle () const { return hdl; }
|
||||
|
Loading…
x
Reference in New Issue
Block a user