waxmiguelito / mongoose

Automatically exported from code.google.com/p/mongoose
MIT License
0 stars 0 forks source link

Open SSL doesn't free up its resources when mg_stop() is called #238

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The code of mg_stop() doesn't take into account the initialization done for 
open SSL.

The following (or similar code) needs to be added to mg_stop():

    /* Kill Open SSL if we have to */
    if (ctx->ssl_ctx != NULL)
    {
        int i;

        CRYPTO_set_locking_callback(NULL);

        for (i = 0; i < CRYPTO_num_locks(); i++)
            pthread_mutex_destroy(&ssl_mutexes[i]);

        CRYPTO_set_locking_callback(NULL);
        CRYPTO_set_id_callback(NULL);
    }

Original issue reported on code.google.com by tsahi.le...@gmail.com on 20 Mar 2011 at 9:49

GoogleCodeExporter commented 9 years ago
Submitted 
https://code.google.com/p/mongoose/source/detail?r=55613346687cced913767a5523927
ae36f417bab
Thank you.

Original comment by valenok on 22 Jun 2011 at 7:36