Only call SSL_CTX_free if DO_SSL is defined.
authorMark Michelson <mmichelson@digium.com>
Wed, 23 May 2012 20:30:21 +0000 (20:30 +0000)
committerMark Michelson <mmichelson@digium.com>
Wed, 23 May 2012 20:30:21 +0000 (20:30 +0000)
Thanks to Paul Belanger for pointing out this error.
........

Merged revisions 367416 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 367417 from http://svn.asterisk.org/svn/asterisk/branches/10

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@367418 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/tcptls.c

index a96fb55..a6e444d 100644 (file)
@@ -417,10 +417,12 @@ int ast_ssl_setup(struct ast_tls_config *cfg)
 
 void ast_ssl_teardown(struct ast_tls_config *cfg)
 {
+#ifdef DO_SSL
        if (cfg->ssl_ctx) {
                SSL_CTX_free(cfg->ssl_ctx);
                cfg->ssl_ctx = NULL;
        }
+#endif
 }
 
 struct ast_tcptls_session_instance *ast_tcptls_client_start(struct ast_tcptls_session_instance *tcptls_session)