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 <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
This commit is contained in:
Andreas Rheinhardt
2020-05-25 13:11:36 +02:00
parent af97c9865f
commit 82bf41f3ab
24 changed files with 43 additions and 71 deletions
+1 -2
View File
@@ -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);