Fix potential memory leak If allocation of I2 does not succeed, we need to free I1. Closes #1120
Mathias Gumz akira@fluxbox.org
1 files changed,
3 insertions(+),
11 deletions(-)
jump to
M
src/FbTk/XFontImp.cc
→
src/FbTk/XFontImp.cc
@@ -29,17 +29,8 @@ #include <X11/Xutil.h>
#include <iostream> #include <new> -#ifdef HAVE_CSTDIO - #include <cstdio> -#else - #include <stdio.h> -#endif -#ifdef HAVE_CSTRING - #include <cstring> -#else - #include <string.h> -#endif - +#include <cstdio> +#include <cstring> #include <algorithm>@@ -275,6 +266,7 @@ cerr << "XFontImp: " <<_FBTK_CONSOLETEXT(Error, CreateXImage,
"Can't create XImage", "XCreateImage failed for some reason") << "." << endl; + XDestroyImage(I1); free(bitdata); delete rotfont; m_rotfonts[orient] = 0;