diff options
author | Alexander Traud <pabstraud@compuserve.com> | 2017-10-13 15:12:07 +0200 |
---|---|---|
committer | Alexander Traud <pabstraud@compuserve.com> | 2017-10-13 08:15:21 -0500 |
commit | 5ef837733409a0b7431f8ffacb0ddd9f6f8b0cdd (patch) | |
tree | 9e8a765461bb267740fc9e21143be49399f2659a /main/tcptls.c | |
parent | 9f9371952cdf5602ddb89b734337c42571e613ad (diff) |
tcptls: NULL-check the parameter of ast_ssl_teardown before accessing it.
This avoids a crash on stopping a chan_sip which failed to start its TLS server.
ASTERISK-27339 #close
Change-Id: I327fc70db68eaaca5b50a15c7fd687fde79263d5
Diffstat (limited to 'main/tcptls.c')
-rw-r--r-- | main/tcptls.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/main/tcptls.c b/main/tcptls.c index dbcff9da2..a25e25b53 100644 --- a/main/tcptls.c +++ b/main/tcptls.c @@ -500,7 +500,7 @@ 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) { + if (cfg && cfg->ssl_ctx) { SSL_CTX_free(cfg->ssl_ctx); cfg->ssl_ctx = NULL; } |