[FFmpeg-devel,2/2] lavf/tcp.c: Free allocated client URLContext in case of error.

Submitted by Stephan Holljes on Jan. 12, 2018, 6:16 p.m.

Details

Message ID 20180112181630.22533-2-klaxa1337@googlemail.com
State New
Headers show

Commit Message

Stephan Holljes Jan. 12, 2018, 6:16 p.m.
Signed-off-by: Stephan Holljes <klaxa1337@googlemail.com>
---
 libavformat/tcp.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Michael Niedermayer Jan. 12, 2018, 7:47 p.m.
On Fri, Jan 12, 2018 at 07:16:30PM +0100, Stephan Holljes wrote:
> Signed-off-by: Stephan Holljes <klaxa1337@googlemail.com>
> ---
>  libavformat/tcp.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)

patchset is probably ok

[...]

Patch hide | download patch | download mbox

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