--- rxvt-unicode/src/rxvttoolkit.C 2010/01/24 21:53:13 1.104 +++ rxvt-unicode/src/rxvttoolkit.C 2010/02/22 09:47:41 1.106 @@ -429,11 +429,11 @@ #ifdef LOCAL_X_IS_UNIX if (id[0] == ':') { - val = rxvt_malloc (5 + strlen (id) + 1); + if (!(val = rxvt_temp_buf (5 + strlen (id) + 1))) + return false; strcpy (val, "unix/"); strcat (val, id); dpy = XOpenDisplay (val); - free (val); } else #endif @@ -609,8 +609,9 @@ if (cur_owner && cur_owner != owner) { - cur_owner->selection_clear (clipboard); - cur_owner->flush (); + rxvt_term *term = cur_owner; + term->selection_clear (clipboard); + term->flush (); } cur_owner = owner; @@ -636,7 +637,7 @@ l = strlen (locale); m = strlen (modifiers); - if (!(id = (char *)malloc (l + m + 2))) + if (!(id = rxvt_temp_buf (l + m + 2))) return 0; memcpy (id, locale, l); id[l] = '\n'; @@ -644,8 +645,6 @@ rxvt_xim *xim = xims.get (id); - free (id); - return xim; }