diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2021-12-27 11:16:04 +0100 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2021-12-27 11:16:04 +0100 |
commit | a16a451c1f411b223066209ff7cd840f40c7757c (patch) | |
tree | 9cf38b7e414239414aac23256feccf844d00e6e4 /font.c | |
parent | 26412e88881697f2ca54164e20dfe75173d1ffd6 (diff) | |
download | vdr-a16a451c1f411b223066209ff7cd840f40c7757c.tar.gz vdr-a16a451c1f411b223066209ff7cd840f40c7757c.tar.bz2 |
Fixed a possible memory leak in creating fonts
Diffstat (limited to 'font.c')
-rw-r--r-- | font.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -6,7 +6,7 @@ * * BiDi support by Osama Alrawab <alrawab@hotmail.com> @2008 Tripoli-Libya. * - * $Id: font.c 4.2 2016/12/22 12:31:23 kls Exp $ + * $Id: font.c 4.2.1.1 2021/12/27 11:14:05 kls Exp $ */ #include "font.h" @@ -429,8 +429,10 @@ cFont *cFont::CreateFont(const char *Name, int CharHeight, int CharWidth) { cString fn = GetFontFileName(Name); cFont *f = *fn ? new cFreetypeFont(fn, CharHeight, CharWidth) : NULL; - if (!f || !f->Height()) + if (!f || !f->Height()) { + delete f; f = new cDummyFont(CharHeight, CharWidth); + } return f; } |