emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r116929: * xterm.c (x_term_init) [USE_LUCID]: Fix mi


From: Dmitry Antipov
Subject: [Emacs-diffs] trunk r116929: * xterm.c (x_term_init) [USE_LUCID]: Fix minor memory leak.
Date: Wed, 02 Apr 2014 16:17:18 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 116929
revision-id: address@hidden
parent: address@hidden
committer: Dmitry Antipov <address@hidden>
branch nick: trunk
timestamp: Wed 2014-04-02 20:17:08 +0400
message:
  * xterm.c (x_term_init) [USE_LUCID]: Fix minor memory leak.
modified:
  src/ChangeLog                  changelog-20091113204419-o5vbwnq5f7feedwu-1438
  src/xterm.c                    xterm.c-20091113204419-o5vbwnq5f7feedwu-244
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2014-04-02 15:14:50 +0000
+++ b/src/ChangeLog     2014-04-02 16:17:08 +0000
@@ -23,6 +23,8 @@
        (font_matching_entity): Likewise.  If matching entity is found, insert
        1-item vector with this entity instead of entity itself (Bug#17125).
 
+       * xterm.c (x_term_init) [USE_LUCID]: Fix minor memory leak.
+
 2014-04-01  Paul Eggert  <address@hidden>
 
        * fns.c (validate_subarray): Rename from validate_substring,

=== modified file 'src/xterm.c'
--- a/src/xterm.c       2014-04-02 15:14:50 +0000
+++ b/src/xterm.c       2014-04-02 16:17:08 +0000
@@ -10162,6 +10162,7 @@
 
 #ifdef USE_LUCID
   {
+    XFontStruct *xfont = NULL;
     XrmValue d, fr, to;
     Font font;
 
@@ -10175,8 +10176,10 @@
     x_catch_errors (dpy);
     if (!XtCallConverter (dpy, XtCvtStringToFont, &d, 1, &fr, &to, NULL))
       emacs_abort ();
-    if (x_had_errors_p (dpy) || !XQueryFont (dpy, font))
+    if (x_had_errors_p (dpy) || !((xfont = XQueryFont (dpy, font))))
       XrmPutLineResource (&xrdb, "Emacs.dialog.*.font: 9x15");
+    if (xfont)
+      XFreeFont (dpy, xfont);
     x_uncatch_errors ();
   }
 #endif


reply via email to

[Prev in Thread] Current Thread [Next in Thread]