From 12d3e0df9980822282f70dffad148b729dbee541 Mon Sep 17 00:00:00 2001 From: diego Date: Sun, 7 Nov 2010 12:47:40 +0000 Subject: cleanup: don't check for NULL before free() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit patch by Clément Bœsch, ubitux gmail com git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32598 b3059339-0415-0410-9bf9-f77b7e298cf2 --- m_option.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'm_option.c') diff --git a/m_option.c b/m_option.c index 6e814bf8b5..daab955614 100644 --- a/m_option.c +++ b/m_option.c @@ -446,8 +446,7 @@ static int parse_str(const m_option_t* opt,const char *name, const char *param, } if(dst) { - if(VAL(dst)) - free(VAL(dst)); + free(VAL(dst)); VAL(dst) = strdup(param); } @@ -462,7 +461,7 @@ static char* print_str(const m_option_t* opt, const void* val) { static void copy_str(const m_option_t* opt,void* dst, const void* src) { if(dst && src) { #ifndef NO_FREE - if(VAL(dst)) free(VAL(dst)); //FIXME!!! + free(VAL(dst)); //FIXME!!! #endif VAL(dst) = VAL(src) ? strdup(VAL(src)) : NULL; } @@ -577,7 +576,7 @@ static int str_list_del(char** del, int n,void* dst) { free(del); if(s == 0) { - if(lst) free(lst); + free(lst); VAL(dst) = NULL; return 1; } @@ -590,7 +589,7 @@ static int str_list_del(char** del, int n,void* dst) { } d[s] = NULL; - if(lst) free(lst); + free(lst); VAL(dst) = d; return 1; @@ -783,7 +782,7 @@ static void free_func_pf(void* src) { while(s) { n = s->next; free(s->name); - if(s->param) free(s->param); + free(s->param); free(s); s = n; } -- cgit v1.2.3