Fix memory leaks when using PolarSSL. Valgrind says it's 100% leak free now :)
authorfatbob313 <martin@fatbob.nu>
Sun, 14 Feb 2010 10:15:14 +0000 (10:15 +0000)
committerfatbob313 <martin@fatbob.nu>
Sun, 14 Feb 2010 10:15:14 +0000 (10:15 +0000)
src/ssl.c

index dc2245352b6fff895948f665ceca3087c5861c4a..9d82cac4fbb097bdd8ece12af9ace8d8eedc0d39 100644 (file)
--- a/src/ssl.c
+++ b/src/ssl.c
@@ -109,6 +109,7 @@ static void initCert()
                if (rc != 0)
                        Log_fatal("Could not read certificate file %s", crtfile);
        }
+       free(ca_file);
 }
 
 static void initKey()
@@ -230,7 +231,9 @@ void SSLi_shutdown(SSL_handle_t *ssl)
 
 void SSLi_free(SSL_handle_t *ssl)
 {
-       free(ssl->session);
+       Log_debug("SSLi_free");
+       free(ssl->session); /* XXX - Hmmm. */
+       ssl_free(ssl);
        free(ssl);
 }