summaryrefslogtreecommitdiff
path: root/plugingui
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2015-12-31 16:30:14 +0100
committerBent Bisballe Nyeng <deva@aasimon.org>2015-12-31 16:30:14 +0100
commit88052c9d3dbe22c5ce16ea03dadd00d85ee03b56 (patch)
tree32e0907ca2cc8f5b11912d6b8b24b021b8418d6a /plugingui
parent33fde43491bd5ac0c357b387e51524b142fdfe75 (diff)
Fix a couple of errors detected by coverity.
Diffstat (limited to 'plugingui')
-rw-r--r--plugingui/directory.cc2
-rw-r--r--plugingui/nativewindow_x11.h14
-rw-r--r--plugingui/painter.cc1
-rw-r--r--plugingui/plugingui.h4
4 files changed, 11 insertions, 10 deletions
diff --git a/plugingui/directory.cc b/plugingui/directory.cc
index c7a17b2..08bf59a 100644
--- a/plugingui/directory.cc
+++ b/plugingui/directory.cc
@@ -264,7 +264,7 @@ Directory::EntryList Directory::listFiles(std::string path, unsigned char filter
entries.push_back(file);
}
-
+ closedir(dir);
return entries;
}
diff --git a/plugingui/nativewindow_x11.h b/plugingui/nativewindow_x11.h
index d7b3902..134ab6f 100644
--- a/plugingui/nativewindow_x11.h
+++ b/plugingui/nativewindow_x11.h
@@ -56,17 +56,17 @@ private:
Event* translateXMessage(XEvent& xevent, bool peek = false);
XImage* createImageFromBuffer(unsigned char* buf, int width, int height);
- ::Window xwindow;
- GC gc;
- XImage* buffer;
+ ::Window xwindow{0};
+ GC gc{0};
+ XImage* buffer{nullptr};
Window& window;
- int last_click;
+ int last_click{0};
- Display* display;
- int screen;
- Atom wmDeleteMessage;
+ Display* display{nullptr};
+ int screen{0};
+ Atom wmDeleteMessage{0};
};
} // GUI::
diff --git a/plugingui/painter.cc b/plugingui/painter.cc
index a1c3f93..01fae5d 100644
--- a/plugingui/painter.cc
+++ b/plugingui/painter.cc
@@ -193,6 +193,7 @@ void Painter::drawText(int x0, int y0, const Font& font,
// If the text offset is outside the buffer; skip it.
if((x0 > (int)pixbuf->width) || (y0 > (int)pixbuf->height))
{
+ delete textbuf;
return;
}
diff --git a/plugingui/plugingui.h b/plugingui/plugingui.h
index bdb7da5..b57855a 100644
--- a/plugingui/plugingui.h
+++ b/plugingui/plugingui.h
@@ -63,10 +63,10 @@ public:
void handleMessage(Message* msg);
DGWindow* window{nullptr};
- EventHandler* eventhandler;
+ EventHandler* eventhandler{nullptr};
- Config* config;
+ Config* config{nullptr};
Notifier<> closeNotifier;