[uim-commit] r1269 - trunk/xim

ekato at freedesktop.org ekato at freedesktop.org
Mon Aug 22 01:34:01 EST 2005


Author: ekato
Date: 2005-08-21 08:33:57 -0700 (Sun, 21 Aug 2005)
New Revision: 1269

Modified:
   trunk/xim/convdisp.cpp
Log:
* xim/convdisp.cpp (update_default_xftfont) : Plug leak.


Modified: trunk/xim/convdisp.cpp
===================================================================
--- trunk/xim/convdisp.cpp	2005-08-21 12:49:11 UTC (rev 1268)
+++ trunk/xim/convdisp.cpp	2005-08-21 15:33:57 UTC (rev 1269)
@@ -99,7 +99,7 @@
 
 void
 update_default_xftfont() {
-    const char *fontname;
+    char *fontname;
     
     if (!uim_scm_symbol_value_bool("uim-xim-use-xft-font?"))
       return;
@@ -118,8 +118,10 @@
 	    free(gXftFontName);
 	    free(gXftFontLocale);
 	    gXftFont = xftfont;
-	    gXftFontName = strdup(fontname);
+	    gXftFontName = fontname;
 	    gXftFontLocale = strdup(setlocale(LC_CTYPE, NULL));
+	} else {
+	    free(fontname);
 	}
     }
 }



More information about the uim-commit mailing list