tls: nullify `.ssl` on handle close
authorFedor Indutny <fedor@indutny.com>
Tue, 9 Feb 2016 21:00:24 +0000 (16:00 -0500)
committerMyles Borins <mborins@us.ibm.com>
Wed, 2 Mar 2016 22:01:11 +0000 (14:01 -0800)
commitf71be242cadcfda59dc9e1042e9a2fff3504450a
treea9f719e1a839fff1127a4477fbc163566f48f1d1
parentdca103877f290b1f731fe04498f79e487e249aad
tls: nullify `.ssl` on handle close

This is an intermediate fix for an issue of accessing `TLSWrap` fields
after the parent handle was destroyed. While `close` listener cleans up
this field automatically, it can be done even earlier at the
`TLSWrap.close` call.

Proper fix is going to be submitted and landed after this one.

Fix: #5108
PR-URL: https://github.com/nodejs/node/pull/5168
Reviewed-By: Shigeki Ohtsu <ohtsu@iij.ad.jp>
lib/_tls_wrap.js
test/parallel/test-tls-regr-gh-5108.js [new file with mode: 0644]