Revision: 7318
Author: nogu.dev
Date: Sun Sep 18 23:31:41 2011
Log: * xim/helper.cpp
- (send_im_list): Plug leak.
http://code.google.com/p/uim/source/detail?r=7318
Modified:
/trunk/xim/helper.cpp
=======================================
--- /trunk/xim/helper.cpp Sun May 1 21:20:23 2011
+++ /trunk/xim/helper.cpp Sun Sep 18 23:31:41 2011
@@ -108,8 +108,10 @@
return;
len = static_cast<int>(strlen(buf) + strlen(tmp));
buf = (char *)realloc(buf, sizeof(char) * len + 1);
- if (!buf)
+ if (!buf) {
+ free(tmp);
return;
+ }
strcat(buf, tmp);
free(tmp);
@@ -119,8 +121,10 @@
return;
len = static_cast<int>(strlen(buf) + strlen(tmp));
buf = (char *)realloc(buf, sizeof(char) * len + 1);
- if (!buf)
+ if (!buf) {
+ free(tmp);
return;
+ }
strcat(buf, tmp);
free(tmp);
} else {
@@ -129,8 +133,10 @@
return;
len = static_cast<int>(strlen(buf) + strlen(tmp));
buf = (char *)realloc(buf, sizeof(char) * len + 1);
- if (!buf)
+ if (!buf) {
+ free(tmp);
return;
+ }
strcat(buf, tmp);
free(tmp);
}