mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2026-01-07 06:35:30 +01:00
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>
This commit is contained in:
@@ -363,10 +363,8 @@ static int rtp_open(URLContext *h, const char *uri, int flags)
|
||||
return 0;
|
||||
|
||||
fail:
|
||||
if (s->rtp_hd)
|
||||
ffurl_close(s->rtp_hd);
|
||||
if (s->rtcp_hd)
|
||||
ffurl_close(s->rtcp_hd);
|
||||
ffurl_closep(&s->rtp_hd);
|
||||
ffurl_closep(&s->rtcp_hd);
|
||||
ffurl_closep(&s->fec_hd);
|
||||
av_free(fec_protocol);
|
||||
av_dict_free(&fec_opts);
|
||||
@@ -506,8 +504,8 @@ static int rtp_close(URLContext *h)
|
||||
|
||||
ff_ip_reset_filters(&s->filters);
|
||||
|
||||
ffurl_close(s->rtp_hd);
|
||||
ffurl_close(s->rtcp_hd);
|
||||
ffurl_closep(&s->rtp_hd);
|
||||
ffurl_closep(&s->rtcp_hd);
|
||||
ffurl_closep(&s->fec_hd);
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user