From 1ff6961231eda8929406b93fe3d70071cbba2469 Mon Sep 17 00:00:00 2001 From: walter harms Date: Fri, 6 Jun 2014 22:53:05 +0200 Subject: Remove more redundant null checks before Xfree() Signed-off-by: Harms Reviewed-by: Alan Coopersmith Signed-off-by: Alan Coopersmith Backported-to-NX-by: Ulrich Sibiller --- nx-X11/lib/X11/omGeneric.c | 43 +++++++++++++++---------------------------- 1 file changed, 15 insertions(+), 28 deletions(-) (limited to 'nx-X11/lib/X11/omGeneric.c') diff --git a/nx-X11/lib/X11/omGeneric.c b/nx-X11/lib/X11/omGeneric.c index 89d1b2ffd..91f4280d0 100644 --- a/nx-X11/lib/X11/omGeneric.c +++ b/nx-X11/lib/X11/omGeneric.c @@ -196,16 +196,12 @@ init_fontset( return True; err: - if(font_set->font_data) - Xfree(font_set->font_data); - if(font_set->substitute) - Xfree(font_set->substitute); - if(font_set->vmap) - Xfree(font_set->vmap); - if(font_set->vrotate) - Xfree(font_set->vrotate); - if(font_set) - Xfree(font_set); + + Xfree(font_set->font_data); + Xfree(font_set->substitute); + Xfree(font_set->vmap); + Xfree(font_set->vrotate); + Xfree(font_set); gen->font_set = (FontSet) NULL; gen->font_set_num = 0; return False; @@ -504,8 +500,8 @@ init_core_part( return True; err: - if (font_name_list) - Xfree(font_name_list); + + Xfree(font_name_list); Xfree(font_struct_list); return False; @@ -1486,24 +1482,15 @@ destroy_oc( */ /* For VW/UDC end */ - if (oc->core.base_name_list) - Xfree(oc->core.base_name_list); - - if (oc->core.font_info.font_name_list) - XFreeStringList(oc->core.font_info.font_name_list); - - if (oc->core.font_info.font_struct_list) { - Xfree(oc->core.font_info.font_struct_list); - } - - if (oc->core.missing_list.charset_list) - XFreeStringList(oc->core.missing_list.charset_list); + Xfree(oc->core.base_name_list); + XFreeStringList(oc->core.font_info.font_name_list); + Xfree(oc->core.font_info.font_struct_list); + XFreeStringList(oc->core.missing_list.charset_list); #ifdef notdef - if (oc->core.res_name) - Xfree(oc->core.res_name); - if (oc->core.res_class) - Xfree(oc->core.res_class); + + Xfree(oc->core.res_name); + Xfree(oc->core.res_class); #endif Xfree(oc); -- cgit v1.2.3