+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.
if (otspec)
{
FcChar8 *file;
+ bool passed;
OTF *otf;
if (FcPatternGetString (fontset->fonts[i], FC_FILE, 0, &file)
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 */
{
Qimagemagicktype = intern (imtypes[i]);
typelist = Fcons (Qimagemagicktype, typelist);
+ imtypes[i] = (char *) MagickRelinquishMemory (imtypes[i]);
}
+
+ imtypes = (char **) MagickRelinquishMemory (imtypes);
return Fnreverse (typelist);
}