From 6509fe0cacf25f30fb6fce9df9569d14f00f0a8f Mon Sep 17 00:00:00 2001 From: "Matthias S. Benkmann" Date: Sat, 7 Jun 2008 06:14:23 -0700 Subject: fix some memory leaks and uninitialized values --- src/Ewmh.cc | 4 ++-- src/FbTk/FbString.hh | 2 ++ src/WinClient.cc | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Ewmh.cc b/src/Ewmh.cc index fd13a9f..3453b7e 100644 --- a/src/Ewmh.cc +++ b/src/Ewmh.cc @@ -156,8 +156,8 @@ void extractNetWmIcon(Atom net_wm_icon, WinClient& winclient) { } // allocate some memory for the icons at client side - img_pm->data = new char[img_pm->bytes_per_line * height]; - img_mask->data = new char[img_mask->bytes_per_line * height]; + img_pm->data = static_cast(malloc(img_pm->bytes_per_line * height)); + img_mask->data = static_cast(malloc(img_mask->bytes_per_line * height)); const unsigned long* src = icon_data.begin()->second; diff --git a/src/FbTk/FbString.hh b/src/FbTk/FbString.hh index 21185f4..1e473cc 100644 --- a/src/FbTk/FbString.hh +++ b/src/FbTk/FbString.hh @@ -67,6 +67,8 @@ public: bool setSource(const std::string &encoding); void reset() { #ifdef HAVE_ICONV + if (m_iconv != ((iconv_t)-1)) + iconv_close(m_iconv); m_iconv = ((iconv_t)(-1)); #endif } diff --git a/src/WinClient.cc b/src/WinClient.cc index 0295481..a7e689f 100644 --- a/src/WinClient.cc +++ b/src/WinClient.cc @@ -83,6 +83,7 @@ WinClient::WinClient(Window win, BScreen &screen, FluxboxWindow *fbwin): send_close_message(false), m_win_gravity(0), m_title_override(false), + m_icon_override(false), m_window_type(Focusable::TYPE_NORMAL), m_mwm_hint(0), m_strut(0) { -- cgit v0.11.2