summaryrefslogtreecommitdiff
path: root/libavformat/subfile.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-04-03 17:03:38 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-05-25 13:11:36 +0200
commit82bf41f3abce4a13e7c6ad1606eb708f371de87f (patch)
treea76e1dc947a8b2db0dbf821d5c8fcc5e61269a52 /libavformat/subfile.c
parentaf97c9865fe7a48b223e162eabce21cc180f305c (diff)
avformat: Replace ffurl_close() by ffurl_closep() where appropriate
It avoids leaving dangling pointers behind in memory. Also remove redundant checks for whether the URLContext to be closed is already NULL. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'libavformat/subfile.c')
-rw-r--r--libavformat/subfile.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavformat/subfile.c b/libavformat/subfile.c
index 5d8659c8c4..300672e657 100644
--- a/libavformat/subfile.c
+++ b/libavformat/subfile.c
@@ -86,7 +86,7 @@ static int subfile_open(URLContext *h, const char *filename, int flags,
return ret;
c->pos = c->start;
if ((ret = slave_seek(h)) < 0) {
- ffurl_close(c->h);
+ ffurl_closep(&c->h);
return ret;
}
return 0;
@@ -95,7 +95,7 @@ static int subfile_open(URLContext *h, const char *filename, int flags,
static int subfile_close(URLContext *h)
{
SubfileContext *c = h->priv_data;
- return ffurl_close(c->h);
+ return ffurl_closep(&c->h);
}
static int subfile_read(URLContext *h, unsigned char *buf, int size)