diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-09-04 14:37:42 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-09-04 14:52:35 -0400 |
commit | 274efb126324f3f8a7e98b15a697c0038a9803d0 (patch) | |
tree | 06b7ab7f8442c1885b39bbb571d0d59b99a00b61 /src/lib/tls/tortls_nss.c | |
parent | ad94d43fc50525e8814b6e99f78d4b9635fa80ca (diff) | |
download | tor-274efb126324f3f8a7e98b15a697c0038a9803d0.tar.gz tor-274efb126324f3f8a7e98b15a697c0038a9803d0.zip |
Use FREE_AND_NULL for impl types
Diffstat (limited to 'src/lib/tls/tortls_nss.c')
-rw-r--r-- | src/lib/tls/tortls_nss.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lib/tls/tortls_nss.c b/src/lib/tls/tortls_nss.c index 266455049e..548a817e63 100644 --- a/src/lib/tls/tortls_nss.c +++ b/src/lib/tls/tortls_nss.c @@ -298,8 +298,10 @@ tor_tls_context_new(crypto_pk_t *identity, } void -tor_tls_context_impl_free(tor_tls_context_impl_t *ctx) +tor_tls_context_impl_free_(tor_tls_context_impl_t *ctx) { + if (!ctx) + return; PR_Close(ctx); } @@ -409,6 +411,8 @@ tor_tls_impl_free_(tor_tls_impl_t *tls) { // XXXX This will close the underlying fd, which our OpenSSL version does // not do! + if (!tls) + return; PR_Close(tls); } |