From 6f23241ba9d7d908534dade0e03041486a970ddc Mon Sep 17 00:00:00 2001
From: Andrei Karas <akaras@inbox.ru>
Date: Sat, 2 Mar 2013 21:19:07 +0300
Subject: Other fixes after Coverity checks.

---
 src/being.cpp                  | 9 ++++-----
 src/guichan/widgets/window.cpp | 4 ++++
 src/test/testmain.cpp          | 6 ++++++
 src/test/testmain.h            | 2 ++
 4 files changed, 16 insertions(+), 5 deletions(-)

(limited to 'src')

diff --git a/src/being.cpp b/src/being.cpp
index 5448be58a..7b494b4a7 100644
--- a/src/being.cpp
+++ b/src/being.cpp
@@ -1156,9 +1156,11 @@ void Being::setAction(const Action &action, const int attackId)
         case DEAD:
             currentAction = SpriteAction::DEAD;
             if (mInfo)
+            {
                 sound.playSfx(mInfo->getSound(SOUND_EVENT_DIE), mX, mY);
-            if (mType == MONSTER || mType == NPC)
-                mYDiff = mInfo->getDeadSortOffsetY();
+                if (mType == MONSTER || mType == NPC)
+                    mYDiff = mInfo->getDeadSortOffsetY();
+            }
             break;
         case STAND:
             currentAction = SpriteAction::STAND;
@@ -2183,9 +2185,6 @@ void Being::drawHpBar(Graphics *const graphics, const int maxHP, const int hp,
     if (maxHP <= 0 || !userPalette)
         return;
 
-    if (!hp && maxHP < hp)
-        return;
-
     float p;
 
     if (hp)
diff --git a/src/guichan/widgets/window.cpp b/src/guichan/widgets/window.cpp
index feb337828..e541ef242 100644
--- a/src/guichan/widgets/window.cpp
+++ b/src/guichan/widgets/window.cpp
@@ -65,6 +65,8 @@ namespace gcn
         mTitleBarHeight(16),
         mMovable(true),
         mOpaque(true),
+        mDragOffsetX(0),
+        mDragOffsetY(0),
         mMoved(false)
     {
         mFrameSize = 1;
@@ -80,6 +82,8 @@ namespace gcn
         mTitleBarHeight(16),
         mMovable(true),
         mOpaque(true),
+        mDragOffsetX(0),
+        mDragOffsetY(0),
         mMoved(false)
     {
         mFrameSize = 1;
diff --git a/src/test/testmain.cpp b/src/test/testmain.cpp
index 42e4ea9bd..c150a8b99 100644
--- a/src/test/testmain.cpp
+++ b/src/test/testmain.cpp
@@ -45,6 +45,12 @@ TestMain::TestMain() :
         + std::string("/manaplustest.log"));
 }
 
+TestMain::~TestMain()
+{
+    delete log;
+    log = nullptr;
+}
+
 void TestMain::initConfig()
 {
     mConfig.init(Client::getConfigDirectory() + "/test.xml");
diff --git a/src/test/testmain.h b/src/test/testmain.h
index f2913fe30..5e9a94f0d 100644
--- a/src/test/testmain.h
+++ b/src/test/testmain.h
@@ -36,6 +36,8 @@ class TestMain
 
         A_DELETE_COPY(TestMain)
 
+        ~TestMain();
+
         int exec(const bool testAudio = true);
 
         static int readValue(const int ver, int def);
-- 
cgit v1.2.3-70-g09d2