[FFmpeg-cvslog] avformat/hlsenc: Fix memleak of path
Michael Niedermayer
git at videolan.org
Thu Sep 3 11:41:17 CEST 2015
ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Thu Sep 3 11:18:10 2015 +0200| [4cad4bd4ca6add29562efcd0fb447c1973a0e1ce] | committer: Michael Niedermayer
avformat/hlsenc: Fix memleak of path
Fixes: CID1322343
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4cad4bd4ca6add29562efcd0fb447c1973a0e1ce
---
libavformat/hlsenc.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index 861faf9..d7bb0c1 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -120,7 +120,8 @@ static int hls_delete_old_segments(HLSContext *hls) {
HLSSegment *segment, *previous_segment = NULL;
float playlist_duration = 0.0f;
int ret = 0, path_size, sub_path_size;
- char *dirname = NULL, *p, *path, *sub_path;
+ char *dirname = NULL, *p, *sub_path;
+ char *path = NULL;
segment = hls->segments;
while (segment) {
@@ -182,7 +183,7 @@ static int hls_delete_old_segments(HLSContext *hls) {
av_log(hls, AV_LOG_ERROR, "failed to delete old segment %s: %s\n",
sub_path, strerror(errno));
}
- av_free(path);
+ av_freep(&path);
av_free(sub_path);
previous_segment = segment;
segment = previous_segment->next;
@@ -190,6 +191,7 @@ static int hls_delete_old_segments(HLSContext *hls) {
}
fail:
+ av_free(path);
av_free(dirname);
return ret;
More information about the ffmpeg-cvslog
mailing list