diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2016-04-05 10:26:06 +0200 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2016-04-05 10:30:28 +0200 |
commit | 41abcc5825d33d78bd370997ba664e3c64eb6683 (patch) | |
tree | 5d69acdb43f4b1a415e2d870a18ff18675f0c9df /winsup/cygwin/path.cc | |
parent | 722e363c4de410e67f24d0da3129c446074716bc (diff) | |
download | cygnal-41abcc5825d33d78bd370997ba664e3c64eb6683.tar.gz cygnal-41abcc5825d33d78bd370997ba664e3c64eb6683.tar.bz2 cygnal-41abcc5825d33d78bd370997ba664e3c64eb6683.zip |
Revert "Refactor to avoid nonnull checks on "this" pointer."
This reverts commit 0008bdea02b690ab19ffe997499cb9a96ee5a66d.
This patch introduced a regression. Calling FOO=$(...) in zsh hangs
indefinitely and has to be killed forcefully.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diffstat (limited to 'winsup/cygwin/path.cc')
-rw-r--r-- | winsup/cygwin/path.cc | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index e48a2cdcd..a839c0ad7 100644 --- a/winsup/cygwin/path.cc +++ b/winsup/cygwin/path.cc @@ -3932,7 +3932,7 @@ fcwd_access_t::Free (PVOID heap) { /* Decrement the reference count. If it's down to 0, free structure from heap. */ - if (InterlockedDecrement (&ReferenceCount ()) == 0) + if (this && InterlockedDecrement (&ReferenceCount ()) == 0) { /* In contrast to pre-Vista, the handle on init is always a fresh one and not the handle inherited from the parent @@ -4320,8 +4320,7 @@ cwdstuff::override_win32_cwd (bool init, ULONG old_dismount_count) f_cwd->CopyPath (upp_cwd_str); upp_cwd_hdl = dir; RtlLeaveCriticalSection (peb.FastPebLock); - if (old_cwd) - old_cwd->Free (heap); + old_cwd->Free (heap); } else { |