Message ID | 20170411180502.12739-2-klaxa1337@googlemail.com |
---|---|
State | Superseded |
Headers | show |
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 [...]
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); return ret; + } cc->fd = ret; return 0; }