Fix leak when calling AsyncSSLSocket::cancelConnect()
Summary: AsyncSSLSocket::connect() creates a new instance of AsyncSSLSocketConnector referred with a raw pointer and passes it to AsyncSocket::connect(). AsyncSSLSocket assumed a callback irrespective of connection success or failure so that this raw pointer will be properly disposed off. However currently, if a connect attempt is cancelled the parent class may end up clearing the connect callback without invoking a connection error, thereby causing a leak. Since the cancelConnect() function also cancels the callback, the raw pointer should be cleaned up during cancellation. Reviewed By: knekritz Differential Revision: D18365027 fbshipit-source-id: 2cc171fc1a026b771dcb0bdd7c45b7ee450b97f7
Showing
Please register or sign in to comment