diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2021-12-20 13:19:52 +0100 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2021-12-20 13:19:52 +0100 |
commit | e7107b789e141005c01319a680a43f800e85413c (patch) | |
tree | 0a2fdcc067754209cb02bd8677148106312951b2 | |
parent | f2e71eb66887e32c95252193eff0401880dbb986 (diff) | |
download | vdr-e7107b789e141005c01319a680a43f800e85413c.tar.gz vdr-e7107b789e141005c01319a680a43f800e85413c.tar.bz2 |
Fixed a possible memory leak in creating fonts
-rw-r--r-- | CONTRIBUTORS | 1 | ||||
-rw-r--r-- | HISTORY | 4 | ||||
-rw-r--r-- | font.c | 6 |
3 files changed, 9 insertions, 2 deletions
diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 3ec812ce..dd6c513c 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -3668,6 +3668,7 @@ Helmut Binder <cco@aon.at> for removing unused declaration of cDvbTuner::SetFrontendType() for fixing handling incomplete multi-packet CAT for fixing a memory leak in handling the NIT + for reporting a possible memory leak in creating fonts Ulrich Eckhardt <uli@uli-eckhardt.de> for reporting a problem with shutdown after user inactivity in case a plugin is @@ -9746,3 +9746,7 @@ Video Disk Recorder Revision History - Fixed unlocking vs. call to EpgHandlers.EndSegmentTransfer() (reported by Christoph Haubrich). - Fixed a memory leak in handling the NIT (thanks to Helmut Binder). + +2021-12-20: + +- Fixed a possible memory leak in creating fonts (reported by Helmut Binder). @@ -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 5.1 2021/12/20 13:19:52 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; } |