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 /libvo | |
parent | af4b23cd36cff0dc34cde59c6a154fd080d11216 (diff) |
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 'libvo')
-rw-r--r-- | libvo/font_load.c | 12 | ||||
-rw-r--r-- | libvo/font_load_ft.c | 26 |
2 files changed, 17 insertions, 21 deletions
diff --git a/libvo/font_load.c b/libvo/font_load.c index e7d36d8a2c..e9980b8e41 100644 --- a/libvo/font_load.c +++ b/libvo/font_load.c @@ -169,8 +169,7 @@ while(fgets(sor,1020,f)){ if(strcmp(section,"[fpath]")==0){ if(pdb==1){ - if (desc->fpath) - free (desc->fpath); // release previously allocated memory + free (desc->fpath); // release previously allocated memory desc->fpath=strdup(p[0]); continue; } @@ -345,12 +344,9 @@ return desc; fail_out: if (f) fclose(f); - if (desc->fpath) - free(desc->fpath); - if (desc->name) - free(desc->name); - if (desc) - free(desc); + free(desc->fpath); + free(desc->name); + free(desc); return NULL; } diff --git a/libvo/font_load_ft.c b/libvo/font_load_ft.c index 3ba90bd5da..3c1ff55d19 100644 --- a/libvo/font_load_ft.c +++ b/libvo/font_load_ft.c @@ -859,27 +859,27 @@ void free_font_desc(font_desc_t *desc) // if (!desc->dynamic) return; // some vo_aa crap, better leaking than crashing - if (desc->name) free(desc->name); - if (desc->fpath) free(desc->fpath); + free(desc->name); + free(desc->fpath); for(i = 0; i < 16; i++) { if (desc->pic_a[i]) { - if (desc->pic_a[i]->bmp) free(desc->pic_a[i]->bmp); - if (desc->pic_a[i]->pal) free(desc->pic_a[i]->pal); - free (desc->pic_a[i]); + free(desc->pic_a[i]->bmp); + free(desc->pic_a[i]->pal); + free(desc->pic_a[i]); } if (desc->pic_b[i]) { - if (desc->pic_b[i]->bmp) free(desc->pic_b[i]->bmp); - if (desc->pic_b[i]->pal) free(desc->pic_b[i]->pal); - free (desc->pic_b[i]); + free(desc->pic_b[i]->bmp); + free(desc->pic_b[i]->pal); + free(desc->pic_b[i]); } } - if (desc->tables.g) free(desc->tables.g); - if (desc->tables.gt2) free(desc->tables.gt2); - if (desc->tables.om) free(desc->tables.om); - if (desc->tables.omt) free(desc->tables.omt); - if (desc->tables.tmp) free(desc->tables.tmp); + free(desc->tables.g); + free(desc->tables.gt2); + free(desc->tables.om); + free(desc->tables.omt); + free(desc->tables.tmp); for(i = 0; i < desc->face_cnt; i++) { FT_Done_Face(desc->faces[i]); |