mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-13 02:20:07 +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:
@@ -293,7 +293,7 @@ cond_wakeup_background_fail:
|
||||
cond_wakeup_main_fail:
|
||||
pthread_mutex_destroy(&c->mutex);
|
||||
mutex_fail:
|
||||
ffurl_close(c->inner);
|
||||
ffurl_closep(&c->inner);
|
||||
url_fail:
|
||||
ring_destroy(&c->ring);
|
||||
fifo_fail:
|
||||
@@ -317,7 +317,7 @@ static int async_close(URLContext *h)
|
||||
pthread_cond_destroy(&c->cond_wakeup_background);
|
||||
pthread_cond_destroy(&c->cond_wakeup_main);
|
||||
pthread_mutex_destroy(&c->mutex);
|
||||
ffurl_close(c->inner);
|
||||
ffurl_closep(&c->inner);
|
||||
ring_destroy(&c->ring);
|
||||
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user