diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2010-06-01 17:14:37 +0400 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2010-06-01 17:14:37 +0400 |
commit | 80a10a3972bea3e13a8134ff992d1bb1063ef6e2 (patch) | |
tree | 40635f0dc2bfd561b136ad65c62b42b0cac122a2 /winsup/cygwin/fhandler_netdrive.cc | |
parent | 4f5feab5ea962e0889290061d82667d7576f8bab (diff) |
* fhandler_netdrive.cc (fhandler_netdrive::exists): Always free WNet
resource if created.
Diffstat (limited to 'winsup/cygwin/fhandler_netdrive.cc')
-rw-r--r-- | winsup/cygwin/fhandler_netdrive.cc | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/winsup/cygwin/fhandler_netdrive.cc b/winsup/cygwin/fhandler_netdrive.cc index 3de2278ef..4cce69753 100644 --- a/winsup/cygwin/fhandler_netdrive.cc +++ b/winsup/cygwin/fhandler_netdrive.cc @@ -1,6 +1,6 @@ /* fhandler_netdrive.cc: fhandler for // and //MACHINE handling - Copyright 2005, 2006, 2007, 2008 Red Hat, Inc. + Copyright 2005, 2006, 2007, 2008, 2009, 2010 Red Hat, Inc. This file is part of Cygwin. @@ -164,15 +164,9 @@ fhandler_netdrive::exists () nr.lpRemoteName = namebuf; DWORD ret = create_thread_and_wait (GET_RESOURCE_OPENENUM, &nr, &nh, 0, "WNetOpenEnum"); - if (ret != NO_ERROR) - { - if (nh.dom) - WNetCloseEnum (nh.dom); - if (nh.net) - WNetCloseEnum (nh.net); - return 0; - } - return 1; + if (nh.dom) + WNetCloseEnum (nh.dom); + return ret != NO_ERROR ? 0 : 1; } fhandler_netdrive::fhandler_netdrive (): |