Unified · Split
| @@ -578,7 +578,8 @@ static int tls_close(URLContext *h) · 577 unmodified lines | ||
| 578 | 578 | } |
| 579 | 579 | if (c->ctx) |
| 580 | 580 | SSL_CTX_free(c->ctx); |
| 581 | − ffurl_closep(&c->tls_shared.tcp); | |
| 581 | + if (!c->tls_shared.external_sock) | |
| 582 | + ffurl_closep(c->tls_shared.is_dtls ? &c->tls_shared.udp : &c->tls_shared.tcp); | |
| 582 | 583 | if (c->url_bio_method) |
| 583 | 584 | BIO_meth_free(c->url_bio_method); |
| 584 | 585 | return 0; |
| @@ -908,19 +909,6 @@ fail: · 323 unmodified lines | ||
| 908 | 909 | return ret; |
| 909 | 910 | } |
| 910 | 911 | |
| 911 | −/** | |
| 912 | − * Cleanup the DTLS context. | |
| 913 | − */ | |
| 914 | −static av_cold int dtls_close(URLContext *h) | |
| 915 | −{ | |
| 916 | − TLSContext *ctx = h->priv_data; | |
| 917 | − SSL_free(ctx->ssl); | |
| 918 | − SSL_CTX_free(ctx->ctx); | |
| 919 | − av_freep(&ctx->tls_shared.cert_buf); | |
| 920 | − av_freep(&ctx->tls_shared.key_buf); | |
| 921 | − return 0; | |
| 922 | −} | |
| 923 | − | |
| 924 | 912 | static int tls_open(URLContext *h, const char *uri, int flags, AVDictionary **options) |
| 925 | 913 | { |
| 926 | 914 | TLSContext *p = h->priv_data; |
| @@ -1069,7 +1057,7 @@ const URLProtocol ff_dtls_protocol = { · 142 unmodified lines | ||
| 1069 | 1057 | .name = "dtls", |
| 1070 | 1058 | .url_open2 = dtls_start, |
| 1071 | 1059 | .url_handshake = dtls_handshake, |
| 1072 | − .url_close = dtls_close, | |
| 1060 | + .url_close = tls_close, | |
| 1073 | 1061 | .url_read = tls_read, |
| 1074 | 1062 | .url_write = tls_write, |
| 1075 | 1063 | .url_get_file_handle = tls_get_file_handle, |