Mercurial > mplayer.hg
diff sub/sub_cc.c @ 32511:b39155e98ac3
Remove some useless NULL pointer checks before invoking free() on the pointer.
patch by From: Clment Bsch, ubitux gmail com
author | diego |
---|---|
date | Sun, 07 Nov 2010 12:47:40 +0000 |
parents | fbe5c829c69b |
children | 024358659ebd |
line wrap: on
line diff
--- a/sub/sub_cc.c Sun Nov 07 11:03:47 2010 +0000 +++ b/sub/sub_cc.c Sun Nov 07 12:47:40 2010 +0000 @@ -81,7 +81,10 @@ { int i; buf->lines=0; - for(i=0;i<SUB_MAX_TEXT;i++) if(buf->text[i]) {free(buf->text[i]);buf->text[i]=NULL;} + for (i = 0; i < SUB_MAX_TEXT; i++) { + free(buf->text[i]); + buf->text[i] = NULL; + } } @@ -95,7 +98,7 @@ while(buf->lines > cc_lines) { - if(buf->text[0]) free(buf->text[0]); + free(buf->text[0]); for(i = 0; i < (buf->lines - 1); i++) buf->text[i] = buf->text[i+1];