Fix potential memory leak

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

Closes #1120
This commit is contained in:
Mathias Gumz 2015-01-21 21:53:00 +01:00
parent 980ab5e3f5
commit dae7fca7cb

View file

@ -29,17 +29,8 @@
#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 @@ 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;