emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] trunk r116128: Fix two memory leaks discovered with Valgri


From: Dmitry Antipov
Subject: [Emacs-diffs] trunk r116128: Fix two memory leaks discovered with Valgrind.
Date: Thu, 23 Jan 2014 12:18:40 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 116128
revision-id: address@hidden
parent: address@hidden
committer: Dmitry Antipov <address@hidden>
branch nick: trunk
timestamp: Thu 2014-01-23 16:18:08 +0400
message:
  Fix two memory leaks discovered with Valgrind.
  * ftfont.c (ftfont_list) [HAVE_LIBOTF]: Call OTF_close.
  * image.c (Fimagemagick_types): Call MagickRelinquishMemory.
modified:
  src/ChangeLog                  changelog-20091113204419-o5vbwnq5f7feedwu-1438
  src/ftfont.c                   ftfont.c-20091113204419-o5vbwnq5f7feedwu-8542
  src/image.c                    image.c-20091113204419-o5vbwnq5f7feedwu-2969
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2014-01-22 10:29:23 +0000
+++ b/src/ChangeLog     2014-01-23 12:18:08 +0000
@@ -1,3 +1,9 @@
+2014-01-23  Dmitry Antipov  <address@hidden>
+
+       Fix two memory leaks discovered with Valgrind.
+       * ftfont.c (ftfont_list) [HAVE_LIBOTF]: Call OTF_close.
+       * image.c (Fimagemagick_types): Call MagickRelinquishMemory.
+
 2014-01-22  Martin Rudalics  <address@hidden>
 
        Fixes in window size functions around Bug#16430 and Bug#16470.

=== modified file 'src/ftfont.c'
--- a/src/ftfont.c      2014-01-06 06:25:30 +0000
+++ b/src/ftfont.c      2014-01-23 12:18:08 +0000
@@ -1011,6 +1011,7 @@
       if (otspec)
        {
          FcChar8 *file;
+         bool passed;
          OTF *otf;
 
          if (FcPatternGetString (fontset->fonts[i], FC_FILE, 0, &file)
@@ -1019,14 +1020,16 @@
          otf = OTF_open ((char *) file);
          if (! otf)
            continue;
-         if (OTF_check_features (otf, 1,
-                                 otspec->script_tag, otspec->langsys_tag,
-                                 otspec->features[0],
-                                 otspec->nfeatures[0]) != 1
-             || OTF_check_features (otf, 0,
-                                    otspec->script_tag, otspec->langsys_tag,
-                                    otspec->features[1],
-                                    otspec->nfeatures[1]) != 1)
+         passed = (OTF_check_features (otf, 1, otspec->script_tag,
+                                       otspec->langsys_tag,
+                                       otspec->features[0],
+                                       otspec->nfeatures[0]) == 1
+                   && OTF_check_features (otf, 0, otspec->script_tag,
+                                          otspec->langsys_tag,
+                                          otspec->features[1],
+                                          otspec->nfeatures[1]) == 1);
+         OTF_close (otf);
+         if (!passed)
            continue;
        }
 #endif /* HAVE_LIBOTF */

=== modified file 'src/image.c'
--- a/src/image.c       2014-01-14 01:19:42 +0000
+++ b/src/image.c       2014-01-23 12:18:08 +0000
@@ -8546,7 +8546,10 @@
     {
       Qimagemagicktype = intern (imtypes[i]);
       typelist = Fcons (Qimagemagicktype, typelist);
+      imtypes[i] = (char *) MagickRelinquishMemory (imtypes[i]);
     }
+
+  imtypes = (char **) MagickRelinquishMemory (imtypes);
   return Fnreverse (typelist);
 }
 


reply via email to

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