aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/tcp.c
diff options
context:
space:
mode:
authorStephan Holljes <klaxa1337@googlemail.com>2018-01-12 19:16:30 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2018-04-19 03:15:32 +0200
commit37175122824d2706e8d2f67fc067b189ac400cd2 (patch)
tree3994eaa7afc6967c7844c910b8bd6016852cecd1 /libavformat/tcp.c
parent768c0774d82c8dc8eb9c14684b619b0d3b4e2f05 (diff)
downloadffmpeg-37175122824d2706e8d2f67fc067b189ac400cd2.tar.gz
lavf/tcp.c: Free allocated client URLContext in case of error.
Signed-off-by: Stephan Holljes <klaxa1337@googlemail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/tcp.c')
-rw-r--r--libavformat/tcp.c4
1 files changed, 3 insertions, 1 deletions
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;
}