diff options
author | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2020-04-03 17:03:38 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2020-05-25 13:11:36 +0200 |
commit | 82bf41f3abce4a13e7c6ad1606eb708f371de87f (patch) | |
tree | a76e1dc947a8b2db0dbf821d5c8fcc5e61269a52 /libavformat/gopher.c | |
parent | af97c9865fe7a48b223e162eabce21cc180f305c (diff) | |
download | ffmpeg-82bf41f3abce4a13e7c6ad1606eb708f371de87f.tar.gz |
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/gopher.c')
-rw-r--r-- | libavformat/gopher.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/libavformat/gopher.c b/libavformat/gopher.c index 3070b24caf..8b6d14a1f7 100644 --- a/libavformat/gopher.c +++ b/libavformat/gopher.c @@ -68,10 +68,7 @@ static int gopher_connect(URLContext *h, const char *path) static int gopher_close(URLContext *h) { GopherContext *s = h->priv_data; - if (s->hd) { - ffurl_close(s->hd); - s->hd = NULL; - } + ffurl_closep(&s->hd); return 0; } |