From 37175122824d2706e8d2f67fc067b189ac400cd2 Mon Sep 17 00:00:00 2001 From: Stephan Holljes Date: Fri, 12 Jan 2018 19:16:30 +0100 Subject: lavf/tcp.c: Free allocated client URLContext in case of error. Signed-off-by: Stephan Holljes Signed-off-by: Michael Niedermayer --- libavformat/tcp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavformat/tcp.c b/libavformat/tcp.c index 8773493..b0289f8 100644 --- a/libavformat/tcp.c +++ b/libavformat/tcp.c @@ -208,8 +208,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_closep(c); return ret; + } cc->fd = ret; return 0; } -- cgit v1.1