Permalink
Browse files

Fix memory leaks in OpenSSL TLS driver.

SSL context and connection structures were never freed.
Additionally, trusted_certs also was never freed.
  • Loading branch information...
1 parent 1d383ea commit ae00523bf2296f56097e03fde7bd7d55c1c5719f @rraptorr rraptorr committed with badlop Sep 11, 2011
Showing with 6 additions and 0 deletions.
  1. +6 −0 c_src/exmpp_tls_openssl.c
@@ -112,6 +112,12 @@ exmpp_tls_openssl_stop(ErlDrvData drv_data)
driver_free(edd->private_key);
if (edd->expected_id != NULL)
driver_free(edd->expected_id);
+ if (edd->trusted_certs != NULL)
+ driver_free(edd->trusted_certs);
+ if (edd->ssl != NULL)
+ SSL_free(edd->ssl);
+ if (edd->ctx != NULL)
+ SSL_CTX_free(edd->ctx);
driver_free(edd);
}

0 comments on commit ae00523

Please sign in to comment.