summaryrefslogtreecommitdiff
path: root/libavformat/mmsh.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/mmsh.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/mmsh.c')
-rw-r--r--libavformat/mmsh.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/libavformat/mmsh.c b/libavformat/mmsh.c
index 13c0ffe438..495d7fb73b 100644
--- a/libavformat/mmsh.c
+++ b/libavformat/mmsh.c
@@ -65,8 +65,7 @@ static int mmsh_close(URLContext *h)
{
MMSHContext *mmsh = (MMSHContext *)h->priv_data;
MMSContext *mms = &mmsh->mms;
- if (mms->mms_hd)
- ffurl_closep(&mms->mms_hd);
+ ffurl_closep(&mms->mms_hd);
av_freep(&mms->streams);
av_freep(&mms->asf_header);
return 0;
@@ -265,7 +264,7 @@ static int mmsh_open_internal(URLContext *h, const char *uri, int flags, int tim
}
// close the socket and then reopen it for sending the second play request.
- ffurl_close(mms->mms_hd);
+ ffurl_closep(&mms->mms_hd);
memset(headers, 0, sizeof(headers));
if ((err = ffurl_alloc(&mms->mms_hd, httpname, AVIO_FLAG_READ,
&h->interrupt_callback)) < 0) {