[FFmpeg-devel] [PATCH v1] lavf/tls_mbedtls: fix resource leak

Jun Zhao mypopydev at gmail.com
Mon Apr 20 09:58:12 EEST 2020


From: Jun Zhao <barryjzhao at tencent.com>

fix resource leak in mbedtls part.

fix #8614

Signed-off-by: Jun Zhao <barryjzhao at tencent.com>
---
 libavformat/tls_mbedtls.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/tls_mbedtls.c b/libavformat/tls_mbedtls.c
index 9b80a1e..eb4b2a0 100644
--- a/libavformat/tls_mbedtls.c
+++ b/libavformat/tls_mbedtls.c
@@ -62,6 +62,8 @@ static int tls_close(URLContext *h)
     mbedtls_ctr_drbg_free(&tls_ctx->ctr_drbg_context);
     mbedtls_entropy_free(&tls_ctx->entropy_context);
 
+    if (tls_ctx->tls_shared.tcp)
+        ffurl_close(tls_ctx->tls_shared.tcp);
     return 0;
 }
 
-- 
2.7.4



More information about the ffmpeg-devel mailing list