Fix get session callback

This could previously open up the possibility of a double-free!

Closes #996
This commit is contained in:
Steven Fackler 2018-09-17 09:30:16 -07:00 committed by GitHub
parent a01979cfdc
commit 5894cdfdc5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -406,7 +406,7 @@ where
match (*callback)(ssl, data) {
Some(session) => {
let p = session.as_ptr();
mem::forget(p);
mem::forget(session);
*copy = 0;
p
}