From dae7fca7cb38dc51b954c0035afbf43df9272f8c Mon Sep 17 00:00:00 2001 From: Mathias Gumz Date: Wed, 21 Jan 2015 21:53:00 +0100 Subject: Fix potential memory leak If allocation of I2 does not succeed, we need to free I1. Closes #1120 --- src/FbTk/XFontImp.cc | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/FbTk/XFontImp.cc b/src/FbTk/XFontImp.cc index 73ae384..524dc72 100644 --- a/src/FbTk/XFontImp.cc +++ b/src/FbTk/XFontImp.cc @@ -29,17 +29,8 @@ #include #include -#ifdef HAVE_CSTDIO - #include -#else - #include -#endif -#ifdef HAVE_CSTRING - #include -#else - #include -#endif - +#include +#include #include @@ -275,6 +266,7 @@ void XFontImp::rotate(FbTk::Orientation orient) { "Can't create XImage", "XCreateImage failed for some reason") << "." << endl; + XDestroyImage(I1); free(bitdata); delete rotfont; m_rotfonts[orient] = 0; -- cgit v0.11.2