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 --- libvo/font_load.c | 12 ++++-------- libvo/font_load_ft.c | 26 +++++++++++++------------- 2 files changed, 17 insertions(+), 21 deletions(-) (limited to 'libvo') 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]); -- cgit v1.2.3