aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathias Gumz <akira@fluxbox.org>2015-01-21 20:53:00 (GMT)
committerMathias Gumz <akira@fluxbox.org>2015-01-21 20:53:00 (GMT)
commitdae7fca7cb38dc51b954c0035afbf43df9272f8c (patch)
tree14833b324a5e491de668ceb42c94795b45907b55
parent980ab5e3f5a843e1d89a178a5d8e8c260eac5efc (diff)
downloadfluxbox-dae7fca7cb38dc51b954c0035afbf43df9272f8c.zip
fluxbox-dae7fca7cb38dc51b954c0035afbf43df9272f8c.tar.bz2
Fix potential memory leak
If allocation of I2 does not succeed, we need to free I1. Closes #1120
-rw-r--r--src/FbTk/XFontImp.cc14
1 files 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 @@
29 29
30#include <iostream> 30#include <iostream>
31#include <new> 31#include <new>
32#ifdef HAVE_CSTDIO 32#include <cstdio>
33 #include <cstdio> 33#include <cstring>
34#else
35 #include <stdio.h>
36#endif
37#ifdef HAVE_CSTRING
38 #include <cstring>
39#else
40 #include <string.h>
41#endif
42
43#include <algorithm> 34#include <algorithm>
44 35
45 36
@@ -275,6 +266,7 @@ void XFontImp::rotate(FbTk::Orientation orient) {
275 "Can't create XImage", 266 "Can't create XImage",
276 "XCreateImage failed for some reason") 267 "XCreateImage failed for some reason")
277 << "." << endl; 268 << "." << endl;
269 XDestroyImage(I1);
278 free(bitdata); 270 free(bitdata);
279 delete rotfont; 271 delete rotfont;
280 m_rotfonts[orient] = 0; 272 m_rotfonts[orient] = 0;