Browse Source

Set fSocket to -1 after close on an error to prevent a double close.

Signed-off-by: Joe Yasi <joe.yasi@gmail.com>
tags/v1.9.13
Joseph A. Yasi Filipe Coelho <falktx@falktx.com> 2 years ago
parent
commit
dad4b57027
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      posix/JackSocket.cpp

+ 2
- 0
posix/JackSocket.cpp View File

@@ -137,6 +137,7 @@ int JackClientSocket::Connect(const char* dir, const char* name, int which) // A
if (connect(fSocket, (struct sockaddr*)&addr, sizeof(addr)) < 0) {
jack_error("Cannot connect to server socket err = %s", strerror(errno));
close(fSocket);
fSocket = -1;
return -1;
}

@@ -297,6 +298,7 @@ int JackServerSocket::Bind(const char* dir, const char* name, int which) // A re
error:
unlink(fName);
close(fSocket);
fSocket = -1;
return -1;
}



Loading…
Cancel
Save