fix for segfault by Saso Kiselkov

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@37384 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2013-11-19 22:36:08 +00:00
parent 3e72da99e5
commit 97a96d57af
2 changed files with 13 additions and 2 deletions

View file

@ -1,3 +1,8 @@
2013-11-19 Saso Kiselkov <skiselkov>
Releasing a GSTLSHandle (created from +[NSFileHandle sslClass]) after
the TLS handshake will result in a segfault. Fix it.
2013-11-18 Wolfgang Lux <wolfgang.lux@gmail.com>
* Headers/GNUstepBase/NSCalendarDate+GNUstepBase.m:

View file

@ -959,8 +959,14 @@ GSTLSHandlePush(gnutls_transport_ptr_t handle, const void *buffer, size_t len)
- (void) dealloc
{
DESTROY(opts);
DESTROY(session);
// TLS may need to read data during teardown, and we need to wait for it.
[self setNonBlocking: NO];
// Don't DESTROY ivars below. First release them, then set nil, because
// `session' may need this back-reference during TLS teardown.
TEST_RELEASE(opts);
TEST_RELEASE(session);
opts = nil;
session = nil;
[super dealloc];
}