[uim-commit] r226 - trunk/uim
tkng@freedesktop.org
tkng@freedesktop.org
Mon Jan 10 13:04:22 PST 2005
Author: tkng
Date: 2005-01-10 13:04:19 -0800 (Mon, 10 Jan 2005)
New Revision: 226
Modified:
trunk/uim/uim-func.c
Log:
* uim/uim-fun.c:
-(uim_release_preedit_segments): Added NULL check.
-(im_clear_mode_list): Break for loop if NULL str found.
Modified: trunk/uim/uim-func.c
===================================================================
--- trunk/uim/uim-func.c 2005-01-10 20:44:10 UTC (rev 225)
+++ trunk/uim/uim-func.c 2005-01-10 21:04:19 UTC (rev 226)
@@ -207,6 +207,10 @@
uim_release_preedit_segments(uim_context uc)
{
int i;
+
+ if(!uc)
+ return;
+
if (!uc->psegs) {
uc->nr_psegs = 0;
return ;
@@ -520,9 +524,11 @@
return uim_scm_f();
for (i = 0; i < uc->nr_modes; i++) {
- if (uc->modes[i]) {
- free(uc->modes[i]);
- }
+ if (!uc->modes[i])
+ break;
+
+ free(uc->modes[i]);
+ uc->modes[i] = NULL;
}
if (uc->modes) {
free(uc->modes);
More information about the Uim-commit
mailing list