[Asterisk-code-review] format ogg vorbis: Clear ogg/vorbis data structures on close (asterisk[master])
Sean Bright
asteriskteam at digium.com
Fri Apr 14 13:13:47 CDT 2017
Sean Bright has uploaded a new change for review. ( https://gerrit.asterisk.org/5477 )
Change subject: format_ogg_vorbis: Clear ogg/vorbis data structures on close
......................................................................
format_ogg_vorbis: Clear ogg/vorbis data structures on close
On filestream close, we need to clear out the ogg & vorbis data
structures to prevent a memory leak.
ASTERISK-26169 #close
Reported by: Ivan Myalkin
Change-Id: Iee94c5a5d5bdafbf8b181c5c064d15d90ace8274
---
M formats/format_ogg_vorbis.c
1 file changed, 7 insertions(+), 0 deletions(-)
git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/77/5477/1
diff --git a/formats/format_ogg_vorbis.c b/formats/format_ogg_vorbis.c
index d4212a1..9b49c14 100644
--- a/formats/format_ogg_vorbis.c
+++ b/formats/format_ogg_vorbis.c
@@ -273,6 +273,13 @@
* and write out the rest of the data */
vorbis_analysis_wrote(&s->vd, 0);
write_stream(s, fs->f);
+
+ /* Cleanup */
+ ogg_stream_clear(&s->os);
+ vorbis_block_clear(&s->vb);
+ vorbis_dsp_clear(&s->vd);
+ vorbis_comment_clear(&s->vc);
+ vorbis_info_clear(&s->vi);
} else {
/* clear OggVorbis_File handle */
ov_clear(&s->ov_f);
--
To view, visit https://gerrit.asterisk.org/5477
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iee94c5a5d5bdafbf8b181c5c064d15d90ace8274
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Sean Bright <sean.bright at gmail.com>
More information about the asterisk-code-review
mailing list