diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2016-10-20 10:31:24 +0200 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2016-10-20 10:31:24 +0200 |
commit | 61b8d44f1f76df5abb9e53427f07e9f1ad987e32 (patch) | |
tree | f0f84ebfb28ec44254def01211eeca94c76aeed4 /nx-X11/lib/X11/lcGeneric.c | |
parent | da01dc8da1aedb1f75d62c03748a239c54b14483 (diff) | |
parent | 50eb5e4a9bf812895a7d5c4e6ae0775c6910931f (diff) | |
download | nx-libs-61b8d44f1f76df5abb9e53427f07e9f1ad987e32.tar.gz nx-libs-61b8d44f1f76df5abb9e53427f07e9f1ad987e32.tar.bz2 nx-libs-61b8d44f1f76df5abb9e53427f07e9f1ad987e32.zip |
Merge branch 'uli42-pr/fix_compile_warnings' into 3.6.x
Attributes GH PR #230: https://github.com/ArcticaProject/nx-libs/pull/230
Diffstat (limited to 'nx-X11/lib/X11/lcGeneric.c')
-rw-r--r-- | nx-X11/lib/X11/lcGeneric.c | 74 |
1 files changed, 33 insertions, 41 deletions
diff --git a/nx-X11/lib/X11/lcGeneric.c b/nx-X11/lib/X11/lcGeneric.c index 1c78a95c6..58ee5d27c 100644 --- a/nx-X11/lib/X11/lcGeneric.c +++ b/nx-X11/lib/X11/lcGeneric.c @@ -1027,10 +1027,8 @@ freeByteM( } blst = codeset->byteM; for (i = 0; i < codeset->length; i++) { - if (blst[i].byteinfo) { Xfree(blst[i].byteinfo); blst[i].byteinfo = NULL; - } } Xfree(codeset->byteM); codeset->byteM = NULL; @@ -1044,20 +1042,18 @@ freeConversion( if (codeset->mbconv) { mbconv = codeset->mbconv; /* ... */ - if (mbconv->convlist) { - Xfree(mbconv->convlist); - mbconv->convlist = NULL; - } + Xfree(mbconv->convlist); + mbconv->convlist = NULL; + Xfree(mbconv); codeset->mbconv = NULL; } if (codeset->ctconv) { ctconv = codeset->ctconv; /* ... */ - if (ctconv->convlist) { - Xfree(ctconv->convlist); - ctconv->convlist = NULL; - } + Xfree(ctconv->convlist); + ctconv->convlist = NULL; + Xfree(ctconv); codeset->ctconv = NULL; } @@ -1072,14 +1068,12 @@ freeExtdSegment( return; } ctextseg = codeset->ctextseg; - if (ctextseg->name) { - Xfree(ctextseg->name); - ctextseg->name = NULL; - } - if (ctextseg->area) { - Xfree(ctextseg->area); - ctextseg->area = NULL; - } + Xfree(ctextseg->name); + ctextseg->name = NULL; + + Xfree(ctextseg->area); + ctextseg->area = NULL; + Xfree(codeset->ctextseg); codeset->ctextseg = NULL; } @@ -1093,10 +1087,10 @@ freeParseInfo( return; } parse_info = codeset->parse_info; - if (parse_info->encoding) { - Xfree(parse_info->encoding); - parse_info->encoding = NULL; - } + + Xfree(parse_info->encoding); + parse_info->encoding = NULL; + Xfree(codeset->parse_info); codeset->parse_info = NULL; } @@ -1115,10 +1109,10 @@ destroy_CodeSetList( freeConversion(codeset[i]); freeExtdSegment(codeset[i]); freeParseInfo(codeset[i]); - if (codeset[i]->charset_list) { - Xfree(codeset[i]->charset_list); - codeset[i]->charset_list = NULL; - } + + Xfree(codeset[i]->charset_list); + codeset[i]->charset_list = NULL; + Xfree(codeset[i]); codeset[i]=NULL; } Xfree(codeset); gen->codeset_list = NULL; @@ -1130,21 +1124,20 @@ destroy_SegConv( { SegConv seg = gen->segment_conv; int i; + if (gen->segment_conv_num == 0) { return; } for (i=0;i<gen->segment_conv_num;i++) { - if (seg[i].source_encoding) { + Xfree(seg[i].source_encoding); seg[i].source_encoding = NULL; - } - if (seg[i].destination_encoding) { + Xfree(seg[i].destination_encoding); seg[i].destination_encoding = NULL; - } - if (seg[i].conv) { - Xfree(seg[i].conv); seg[i].conv = NULL; - } + + Xfree(seg[i].conv); + seg[i].conv = NULL; } Xfree(seg); gen->segment_conv = NULL; } @@ -1156,14 +1149,13 @@ destroy_gen( XLCdGenericPart *gen = XLC_GENERIC_PART(lcd); destroy_SegConv(gen); destroy_CodeSetList(gen); - if (gen->mb_parse_table) { - Xfree(gen->mb_parse_table); - gen->mb_parse_table = NULL; - } - if (gen->mb_parse_list) { - Xfree(gen->mb_parse_list); - gen->mb_parse_list = NULL; - } + + Xfree(gen->mb_parse_table); + gen->mb_parse_table = NULL; + + Xfree(gen->mb_parse_list); + gen->mb_parse_list = NULL; + } /* VW/UDC end 95.01.08 */ |