aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/srtpproto.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/srtpproto.c
parentaf97c9865fe7a48b223e162eabce21cc180f305c (diff)
downloadffmpeg-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/srtpproto.c')
-rw-r--r--libavformat/srtpproto.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/libavformat/srtpproto.c b/libavformat/srtpproto.c
index 5e6e5164d7..13e2245015 100644
--- a/libavformat/srtpproto.c
+++ b/libavformat/srtpproto.c
@@ -59,8 +59,7 @@ static int srtp_close(URLContext *h)
SRTPProtoContext *s = h->priv_data;
ff_srtp_free(&s->srtp_out);
ff_srtp_free(&s->srtp_in);
- ffurl_close(s->rtp_hd);
- s->rtp_hd = NULL;
+ ffurl_closep(&s->rtp_hd);
return 0;
}