Fix state cleanup if LiStartConnection() fails

This commit is contained in:
Cameron Gutman
2017-05-18 09:52:50 -07:00
parent ec6c569130
commit 2d7bf5be82
7 changed files with 147 additions and 11 deletions

View File

@@ -374,5 +374,9 @@ int LiStartConnection(PSERVER_INFORMATION serverInfo, PSTREAM_CONFIGURATION stre
ListenerCallbacks.connectionStarted();
Cleanup:
if (err != 0) {
// Undo any work we've done here before failing
LiStopConnection();
}
return err;
}