From 82bf41f3abce4a13e7c6ad1606eb708f371de87f Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Fri, 3 Apr 2020 17:03:38 +0200 Subject: avformat: Replace ffurl_close() by ffurl_closep() where appropriate It avoids leaving dangling pointers behind in memory. Also remove redundant checks for whether the URLContext to be closed is already NULL. Reviewed-by: Anton Khirnov Signed-off-by: Andreas Rheinhardt --- libavformat/tls_openssl.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'libavformat/tls_openssl.c') diff --git a/libavformat/tls_openssl.c b/libavformat/tls_openssl.c index e305b2465a..002197fa76 100644 --- a/libavformat/tls_openssl.c +++ b/libavformat/tls_openssl.c @@ -142,8 +142,7 @@ static int tls_close(URLContext *h) } if (c->ctx) SSL_CTX_free(c->ctx); - if (c->tls_shared.tcp) - ffurl_close(c->tls_shared.tcp); + ffurl_closep(&c->tls_shared.tcp); #if OPENSSL_VERSION_NUMBER >= 0x1010000fL if (c->url_bio_method) BIO_meth_free(c->url_bio_method); -- cgit v1.2.3