diff options
author | Nils Wallménius <nils@rockbox.org> | 2010-12-07 16:08:26 +0000 |
---|---|---|
committer | Nils Wallménius <nils@rockbox.org> | 2010-12-07 16:08:26 +0000 |
commit | d44fb16feb02e911e60ab48e3dc52454a03f3736 (patch) | |
tree | e53756caf2add21b2b3dfb8cfcb0a43f48bb43de | |
parent | 13601883d51501880f7fcab2b5494d312d31dc3a (diff) |
libtremor: merge upstream revision 17519 'Correct an accidental dereference-before-check in error cleanup in comments.'
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28758 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/codecs/libtremor/info.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/apps/codecs/libtremor/info.c b/apps/codecs/libtremor/info.c index 62a31d510e..7c9af7ccdb 100644 --- a/apps/codecs/libtremor/info.c +++ b/apps/codecs/libtremor/info.c @@ -44,10 +44,12 @@ void vorbis_comment_init(vorbis_comment *vc){ 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)); } |