aboutsummaryrefslogtreecommitdiff
path: root/src/torcontrol.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/torcontrol.cpp')
-rw-r--r--src/torcontrol.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/torcontrol.cpp b/src/torcontrol.cpp
index f273428625..3665e7e770 100644
--- a/src/torcontrol.cpp
+++ b/src/torcontrol.cpp
@@ -375,8 +375,10 @@ static std::pair<bool,std::string> ReadBinaryFile(const fs::path &filename, size
while ((n=fread(buffer, 1, sizeof(buffer), f)) > 0) {
// Check for reading errors so we don't return any data if we couldn't
// read the entire file (or up to maxsize)
- if (ferror(f))
+ if (ferror(f)) {
+ fclose(f);
return std::make_pair(false,"");
+ }
retval.append(buffer, buffer+n);
if (retval.size() > maxsize)
break;
@@ -404,7 +406,7 @@ static bool WriteBinaryFile(const fs::path &filename, const std::string &data)
/****** Bitcoin specific TorController implementation ********/
/** Controller that connects to Tor control socket, authenticate, then create
- * and maintain a ephemeral hidden service.
+ * and maintain an ephemeral hidden service.
*/
class TorController
{