summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Terriberry <tterribe@xiph.org>2010-10-13 23:37:40 +0000
committerTim Terriberry <tterribe@xiph.org>2010-10-13 23:37:40 +0000
commite8472967173aa6095850a677cbd328f8f7e0523c (patch)
tree9ee53f6395f19b1cbe745a9ab11d052386bf9224
parent529a92ea997b78f9556c39acd1fe507de7b7fa4d (diff)
downloadtremor-e8472967173aa6095850a677cbd328f8f7e0523c.tar.gz
Port r14984 from libvorbis.
Correct an accidental dereference-before-check in error cleanup in comments. git-svn-id: https://svn.xiph.org/trunk/Tremor@17519 0101bb08-14d6-0310-b084-bc0e0c8e3800
-rw-r--r--info.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/info.c b/info.c
index 75e7205..bc7ee8a 100644
--- a/info.c
+++ b/info.c
@@ -92,10 +92,12 @@ int vorbis_comment_query_count(vorbis_comment *vc, char *tag){
void vorbis_comment_clear(vorbis_comment *vc){
if(vc){
long i;
- for(i=0;i<vc->comments;i++)
- if(vc->user_comments[i])_ogg_free(vc->user_comments[i]);
- if(vc->user_comments)_ogg_free(vc->user_comments);
- if(vc->comment_lengths)_ogg_free(vc->comment_lengths);
+ if(vc->user_comments){
+ for(i=0;i<vc->comments;i++)
+ if(vc->user_comments[i])_ogg_free(vc->user_comments[i]);
+ _ogg_free(vc->user_comments);
+ }
+ if(vc->comment_lengths)_ogg_free(vc->comment_lengths);
if(vc->vendor)_ogg_free(vc->vendor);
memset(vc,0,sizeof(*vc));
}