dinhviethoa/libetpan — pull request #44 by welp (2012-10-07 15:42:53+00:00)
Title: Release resources when closing gnutls session

When a gnutls session is initiated (```mailstream_ssl.c:258```), there is a call to ```gnutls_global_init()``` (```mailstream_ssl.c:278```) but no call to ```gnutls_global_deinit()``` which is required in order to release resources by the gnutls session structures.

```gnutls_global_init()``` increments a global counter, and ```gnutls_global_deinit()``` decrements this counter, so resources only get released when ```gnutls_global_deinit()``` is called as many times as ```gnutls_global_init()```.