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>
This commit is contained in:
Stephan Holljes 2018-01-12 19:16:30 +01:00 committed by Michael Niedermayer
parent 768c0774d8
commit 3717512282
1 changed files with 3 additions and 1 deletions

View File

@ -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;
}