diff options
author | diego <diego@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2010-11-07 12:47:40 +0000 |
---|---|---|
committer | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2010-11-08 18:05:12 +0200 |
commit | 12d3e0df9980822282f70dffad148b729dbee541 (patch) | |
tree | d298b2c8f5039eae7aeeb16dfd927bea0efcc134 /m_option.c | |
parent | af4b23cd36cff0dc34cde59c6a154fd080d11216 (diff) | |
download | mpv-12d3e0df9980822282f70dffad148b729dbee541.tar.bz2 mpv-12d3e0df9980822282f70dffad148b729dbee541.tar.xz |
cleanup: don't check for NULL before free()
patch by Clément Bœsch, ubitux gmail com
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@32598 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'm_option.c')
-rw-r--r-- | m_option.c | 11 |
1 files changed, 5 insertions, 6 deletions
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; } |