all repos — fluxbox @ dae7fca7cb38dc51b954c0035afbf43df9272f8c

custom fork of the fluxbox windowmanager

Fix potential memory leak

If allocation of I2 does not succeed, we need to free I1.

Closes #1120
Mathias Gumz akira@fluxbox.org
commit

dae7fca7cb38dc51b954c0035afbf43df9272f8c

parent

980ab5e3f5a843e1d89a178a5d8e8c260eac5efc

1 files changed, 3 insertions(+), 11 deletions(-)

jump to
M src/FbTk/XFontImp.ccsrc/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;