Commit b45ad9f3 authored by Albert Astals Cid's avatar Albert Astals Cid
Browse files

- delete family;

+    delete[] family;
as family is new[]'ed

When assigning family if the font had "the proper info" and family had to be deleted, do it.
parent f93dfc5c
......@@ -987,8 +987,13 @@ FcPattern *buildFcPattern(GfxFont *font)
slant = FC_SLANT_ITALIC;
// if the FontDescriptor specified a family name use it
if (font->getFamily())
if (font->getFamily()) {
if (deleteFamily) {
delete[] family;
deleteFamily = false;
}
family = font->getFamily()->getCString();
}
// if the FontDescriptor specified a weight use it
switch (font -> getWeight())
......@@ -1059,7 +1064,7 @@ FcPattern *buildFcPattern(GfxFont *font)
FC_LANG, FcTypeString, lang,
NULL);
if (deleteFamily)
delete family;
delete[] family;
return p;
}
......
Supports Markdown
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