aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGavin Andresen <[email protected]>2011-05-01 06:41:49 -0700
committerGavin Andresen <[email protected]>2011-05-01 06:41:49 -0700
commit76160f784a0e8ee5e1fdcb9e250e6aee723b44d0 (patch)
tree73c010e38f0a43c24745db76ba29bc4ffeb7b25d
parentMerge pull request #181 from sipa/fixcheckconf. (diff)
parentFix segfault when we're unable to create the lock file. (diff)
downloaddiscoin-76160f784a0e8ee5e1fdcb9e250e6aee723b44d0.tar.xz
discoin-76160f784a0e8ee5e1fdcb9e250e6aee723b44d0.zip
Merge pull request #179 from wizeman/segfault-lockfile.
Fix segfault when we're unable to create the lock file.
-rw-r--r--init.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/init.cpp b/init.cpp
index 8f7218122..a8e93140b 100644
--- a/init.cpp
+++ b/init.cpp
@@ -326,7 +326,7 @@ bool AppInit2(int argc, char* argv[])
// Make sure only a single bitcoin process is using the data directory.
string strLockFile = GetDataDir() + "/.lock";
FILE* file = fopen(strLockFile.c_str(), "a"); // empty lock file; created if it doesn't exist.
- fclose(file);
+ if (file) fclose(file);
static boost::interprocess::file_lock lock(strLockFile.c_str());
if (!lock.try_lock())
{