adobkin / libcapn

A simple C Library for interact with the Apple Push Notification Service (APNs)
MIT License
100 stars 37 forks source link

double SSL_free() and crash. #10

Closed hex2tan closed 9 years ago

hex2tan commented 9 years ago

This is a logical bug. When occured a error, apn_free() will be called to clear something(reference the sample), then apn_close() called by apn_free(). Because after calling SSL_free(ctx->ssl), the ctx->ssl is not NULL, then SSL_free(ctx->ssl) will be called again. And then will be crash. So, SSL_free(ctx->ssl) can't be called here.