[FFmpeg-devel] [PATCH 2/2] lavf/tcp.c: Free allocated client URLContext in case of error.
Stephan Holljes
klaxa1337 at googlemail.com
Fri Jan 12 20:16:30 EET 2018
Signed-off-by: Stephan Holljes <klaxa1337 at googlemail.com>
---
libavformat/tcp.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/libavformat/tcp.c b/libavformat/tcp.c
index 8773493df1..b0289f854f 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;
}
--
2.15.1
More information about the ffmpeg-devel
mailing list