Commit 565935c8 authored by Dmitry Antipov's avatar Dmitry Antipov
Browse files

Fix two memory leaks discovered with Valgrind.

* ftfont.c (ftfont_list) [HAVE_LIBOTF]: Call OTF_close.
* image.c (Fimagemagick_types): Call MagickRelinquishMemory.
parent c51e81ef
2014-01-23 Dmitry Antipov <dmantipov@yandex.ru>
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 <rudalics@gmx.at>
Fixes in window size functions around Bug#16430 and Bug#16470.
......
......@@ -1011,6 +1011,7 @@ ftfont_list (struct frame *f, Lisp_Object spec)
if (otspec)
{
FcChar8 *file;
bool passed;
OTF *otf;
if (FcPatternGetString (fontset->fonts[i], FC_FILE, 0, &file)
......@@ -1019,14 +1020,16 @@ ftfont_list (struct frame *f, Lisp_Object spec)
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 */
......
......@@ -8546,7 +8546,10 @@ and `imagemagick-types-inhibit'. */)
{
Qimagemagicktype = intern (imtypes[i]);
typelist = Fcons (Qimagemagicktype, typelist);
imtypes[i] = (char *) MagickRelinquishMemory (imtypes[i]);
}
imtypes = (char **) MagickRelinquishMemory (imtypes);
return Fnreverse (typelist);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment