Fix potential memory leak
If allocation of I2 does not succeed, we need to free I1. Closes #1120
This commit is contained in:
parent
980ab5e3f5
commit
dae7fca7cb
1 changed files with 3 additions and 11 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue