[FFmpeg-devel] [PATCH 2/2] lavf/tcp.c: Free allocated client URLContext in case of error.
Michael Niedermayer
michael at niedermayer.cc
Thu Jan 11 04:28:16 EET 2018
On Tue, Apr 11, 2017 at 08:05:02PM +0200, Stephan Holljes wrote:
> ---
>
> This version is rebased on Simon's tcp return fix.
>
> libavformat/tcp.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/libavformat/tcp.c b/libavformat/tcp.c
> index 07b4ed9..f1a597d 100644
> --- a/libavformat/tcp.c
> +++ b/libavformat/tcp.c
> @@ -203,8 +203,10 @@ static int tcp_accept(URLContext *s, URLContext **c)
> return ret;
> cc = (*c)->priv_data;
> ret = ff_accept(sc->fd, sc->listen_timeout, s);
> - if (ret < 0)
> + if (ret < 0) {
> + ffurl_close(*c);
this should be ffurl_closep() to clear the freed pointer
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
I know you won't believe me, but the highest form of Human Excellence is
to question oneself and others. -- Socrates
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20180111/4ddd0a2e/attachment.sig>
More information about the ffmpeg-devel
mailing list