Fix minor covscan reviews

This commit is contained in:
Takao Fujiwara 2021-05-26 17:52:09 +09:00
parent c6a1a6e712
commit 9da4726195
2 changed files with 17 additions and 13 deletions

View File

@ -230,9 +230,9 @@ index e153081d..61194816 100644
--
2.28.0
From 65f709bb3a094a031ad7a7a802a12bd9ab7c27e2 Mon Sep 17 00:00:00 2001
From c3c224770a9db120713f86ce836cacbfcb178484 Mon Sep 17 00:00:00 2001
From: fujiwarat <takao.fujiwara1@gmail.com>
Date: Sun, 23 May 2021 23:09:26 +0900
Date: Wed, 26 May 2021 17:46:42 +0900
Subject: [PATCH] Fix code reviews
---
@ -262,10 +262,10 @@ Subject: [PATCH] Fix code reviews
util/IMdkit/i18nIc.c | 41 ++++++++--
util/IMdkit/i18nMethod.c | 24 +++++-
util/IMdkit/i18nOffsetCache.c | 2 +-
util/IMdkit/i18nPtHdr.c | 147 ++++++++++++++++++++++++++++------
util/IMdkit/i18nPtHdr.c | 148 ++++++++++++++++++++++++++++------
util/IMdkit/i18nUtil.c | 20 +++++
util/IMdkit/i18nX.c | 29 ++++---
29 files changed, 523 insertions(+), 172 deletions(-)
29 files changed, 524 insertions(+), 172 deletions(-)
diff --git a/bus/ibusimpl.c b/bus/ibusimpl.c
index e432e849..49a138fe 100644
@ -1627,7 +1627,7 @@ index d5379051..e2fe8c6b 100644
data[i].offset = offset;
}
diff --git a/util/IMdkit/i18nPtHdr.c b/util/IMdkit/i18nPtHdr.c
index eaeeee1c..367cc1e7 100644
index eaeeee1c..8dc52714 100644
--- a/util/IMdkit/i18nPtHdr.c
+++ b/util/IMdkit/i18nPtHdr.c
@@ -181,8 +181,13 @@ static void OpenMessageProc(XIMS ims, IMProtocol *call_data, unsigned char *p)
@ -1816,7 +1816,7 @@ index eaeeee1c..367cc1e7 100644
+ if (!im_attribute_list) {
+ fprintf (stderr, "(XIM-IMdkit) WARNING: malloc failed in %s:%d.\n",
+ __FILE__, __LINE__);
+ goto GetIMValuesMessageProc_finit;
+ goto GetIMValuesMessageProc_finit2;
+ }
/*endif*/
@ -1834,7 +1834,7 @@ index eaeeee1c..367cc1e7 100644
}
/*endif*/
memset (reply, 0, total_size);
@@ -840,12 +895,17 @@ static void GetIMValuesMessageProc (XIMS ims,
@@ -840,12 +895,18 @@ static void GetIMValuesMessageProc (XIMS ims,
0,
reply,
total_size);
@ -1845,6 +1845,8 @@ index eaeeee1c..367cc1e7 100644
- XFree(im_attribute_list[i].value);
- XFree (im_attribute_list);
+GetIMValuesMessageProc_finit:
+ FrameMgrFree (fm);
+GetIMValuesMessageProc_finit2:
+ if (im_attrID_list)
+ XFree (im_attrID_list);
+ if (im_attribute_list) {
@ -1852,11 +1854,10 @@ index eaeeee1c..367cc1e7 100644
+ XFree(im_attribute_list[i].value);
+ XFree (im_attribute_list);
+ }
+ FrameMgrFree (fm);
}
static void CreateICMessageProc (XIMS ims,
@@ -1435,6 +1495,11 @@ static void EncodingNegotiatonMessageProc (XIMS ims,
@@ -1435,6 +1496,11 @@ static void EncodingNegotiatonMessageProc (XIMS ims,
if (byte_length > 0)
{
enc_nego->encoding = (XIMStr *) malloc (sizeof (XIMStr)*10);
@ -1868,7 +1869,7 @@ index eaeeee1c..367cc1e7 100644
memset (enc_nego->encoding, 0, sizeof (XIMStr)*10);
i = 0;
while (FrameMgrIsIterLoopEnd (fm, &status) == False)
@@ -1446,9 +1511,21 @@ static void EncodingNegotiatonMessageProc (XIMS ims,
@@ -1446,9 +1512,21 @@ static void EncodingNegotiatonMessageProc (XIMS ims,
FrameMgrSetSize (fm, str_length);
enc_nego->encoding[i].length = str_length;
FrameMgrGetToken (fm, name);
@ -1890,7 +1891,7 @@ index eaeeee1c..367cc1e7 100644
i++;
}
/*endwhile*/
@@ -1460,20 +1537,37 @@ static void EncodingNegotiatonMessageProc (XIMS ims,
@@ -1460,20 +1538,37 @@ static void EncodingNegotiatonMessageProc (XIMS ims,
if (byte_length > 0)
{
enc_nego->encodinginfo = (XIMStr *) malloc (sizeof (XIMStr)*10);
@ -1929,7 +1930,7 @@ index eaeeee1c..367cc1e7 100644
i++;
}
/*endwhile*/
@@ -1524,6 +1618,7 @@ static void EncodingNegotiatonMessageProc (XIMS ims,
@@ -1524,6 +1619,7 @@ static void EncodingNegotiatonMessageProc (XIMS ims,
total_size);
XFree (reply);

View File

@ -38,7 +38,7 @@
Name: ibus
Version: 1.5.24
Release: 4%{?dist}
Release: 5%{?dist}
Summary: Intelligent Input Bus for Linux OS
License: LGPLv2+
URL: https://github.com/ibus/%name/wiki
@ -494,6 +494,9 @@ dconf update || :
%{_datadir}/installed-tests/ibus
%changelog
* Wed May 26 2021 Takao Fujiwara <tfujiwar@redhat.com> - 1.5.24-5
- Fix minor covscan reviews
* Fri May 21 2021 Takao Fujiwara <tfujiwar@redhat.com> - 1.5.24-4
- Fix covscan reviews
- Implement ibus_im_context_set_surrounding_with_selection()