avformat/rtspdec: fix mem leaks in listen mode if init fails

Reviewed-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
pull/358/head
Andriy Gelman 5 years ago
parent 423d06e0e2
commit 38bc4ba142
  1. 3
      libavformat/rtspdec.c

@ -694,12 +694,13 @@ static int rtsp_listen(AVFormatContext *s)
} else if (methodcode == SETUP) } else if (methodcode == SETUP)
ret = rtsp_read_setup(s, host, uri); ret = rtsp_read_setup(s, host, uri);
if (ret) { if (ret) {
ffurl_close(rt->rtsp_hd);
ret = AVERROR_INVALIDDATA; ret = AVERROR_INVALIDDATA;
goto fail; goto fail;
} }
} }
fail: fail:
ff_rtsp_close_streams(s);
ff_rtsp_close_connections(s);
ff_network_close(); ff_network_close();
return ret; return ret;
} }

Loading…
Cancel
Save