summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRobert Hencke <robert.hencke@gmail.com>2015-09-06 09:53:22 -0400
committerRobert Hencke <robert.hencke@gmail.com>2015-09-06 09:53:22 -0400
commitc10e6ec19c9aed8cef44205a41ec1c57f1dede81 (patch)
treef8ea6f07022278b021bd8ab62cbbe5e20a815de0 /src
parenta66751870fb4e6184ac0a58303cb1f97e499f5fe (diff)
downloadglog-c10e6ec19c9aed8cef44205a41ec1c57f1dede81.tar.gz
glog-c10e6ec19c9aed8cef44205a41ec1c57f1dede81.tar.bz2
glog-c10e6ec19c9aed8cef44205a41ec1c57f1dede81.zip
Fix double-free in unit test on Windows.
The LOG_SYSRESULT refers to result twice. Since, in this test, result expands to FindClose(handle), the handle was being freed twice.
Diffstat (limited to 'src')
-rw-r--r--src/logging_unittest.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/logging_unittest.cc b/src/logging_unittest.cc
index e180567..e0e3676 100644
--- a/src/logging_unittest.cc
+++ b/src/logging_unittest.cc
@@ -635,7 +635,8 @@ static void GetFiles(const string& pattern, vector<string>* files) {
do {
files->push_back(dirname + data.cFileName);
} while (FindNextFileA(handle, &data));
- LOG_SYSRESULT(FindClose(handle));
+ BOOL result = FindClose(handle);
+ LOG_SYSRESULT(result);
#else
# error There is no way to do glob.
#endif