[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [sflphone-kde/abstractmodels] src: [ #24595 ] Fix some Coverity Scan issues
From:       Emmanuel Lepage Vallee <emmanuel.lepage () savoirfairelinux ! com>
Date:       2013-05-31 22:17:47
Message-ID: 20130531221747.955E1A6067 () git ! kde ! org
[Download RAW message or body]

Git commit 32d6026f8fb37aa99e530b86b75bb0d15d20f8bf by Emmanuel Lepage Vallee.
Committed on 01/06/2013 at 00:17.
Pushed by lepagevalleeemmanuel into branch 'abstractmodels'.

[ #24595 ] Fix some Coverity Scan issues

M  +1    -0    src/accountwizard.cpp
M  +3    -1    src/delegates/delegatedropoverlay.cpp
M  +1    -1    src/klib/configurationskeleton.cpp
M  +1    -1    src/klib/tipanimationwrapper.cpp
M  +1    -1    src/lib/account.cpp
M  +1    -1    src/lib/callmodel.cpp
M  +0    -1    src/widgets/categorizedtreeview.cpp
M  +4    -2    src/widgets/tips/ringingtip.cpp

http://commits.kde.org/sflphone-kde/32d6026f8fb37aa99e530b86b75bb0d15d20f8bf

diff --git a/src/accountwizard.cpp b/src/accountwizard.cpp
index 14ee0ab..d0fe040 100644
--- a/src/accountwizard.cpp
+++ b/src/accountwizard.cpp
@@ -133,6 +133,7 @@ int AccountWizard::sendRequest(const QString& host, int port, \
const QString& req  }
 
    fclose(f);
+   delete f;
    shutdown(s, 2);
    ::close(s);
    return 0;
diff --git a/src/delegates/delegatedropoverlay.cpp \
b/src/delegates/delegatedropoverlay.cpp index 9ef8a8a..35b5fb9 100644
--- a/src/delegates/delegatedropoverlay.cpp
+++ b/src/delegates/delegatedropoverlay.cpp
@@ -33,7 +33,7 @@
 
 ///Constructor
 DelegateDropOverlay::DelegateDropOverlay(QObject* parent):QObject(parent),
-m_pTimer(0),m_Init(false),m_Reverse(1)
+m_pTimer(0),m_Init(false),m_Reverse(1),m_lpButtons(nullptr)
 {
    const QColor color = QApplication::palette().base().color();
    const bool dark = (color.red() > 128 && color.green() > 128 && color.blue() > \
128); @@ -52,6 +52,8 @@ DelegateDropOverlay::~DelegateDropOverlay()
 ///How to paint
 void DelegateDropOverlay::paintEvent(QPainter* painter, const QStyleOptionViewItem& \
option, const QModelIndex& index)  {
+   if (!m_lpButtons)
+      return;
    int step = index.data(ContactBackend::Role::DropState).toInt();
    if ((step == 1 || step == -1) && m_lActiveIndexes.indexOf(index) == -1) {
       m_lActiveIndexes << index;
diff --git a/src/klib/configurationskeleton.cpp b/src/klib/configurationskeleton.cpp
index 4d5931c..b15b57e 100644
--- a/src/klib/configurationskeleton.cpp
+++ b/src/klib/configurationskeleton.cpp
@@ -94,7 +94,7 @@ void ConfigurationSkeleton::readConfig()
 
    kDebug() << "configurationManager.getCurrentAudioOutputPlugin() = " << \
configurationManager.getCurrentAudioOutputPlugin();  \
                setAlsaPlugin(configurationManager.getCurrentAudioOutputPlugin());
-   bool ok;
+   bool ok = false;
    QStringList devices = configurationManager.getCurrentAudioDevicesIndex();
    int inputDevice =0;
    if (devices.size() > 1) {
diff --git a/src/klib/tipanimationwrapper.cpp b/src/klib/tipanimationwrapper.cpp
index 1efb9ce..8b9b5b0 100644
--- a/src/klib/tipanimationwrapper.cpp
+++ b/src/klib/tipanimationwrapper.cpp
@@ -26,7 +26,7 @@
 #include "tipmanager.h"
 
 TipAnimationWrapper::TipAnimationWrapper(QObject* parent) : \
                QObject(parent),m_MaxStep(15),m_Step(0),m_pTimer(nullptr),m_TipSize(QSize(0,0)),
                
-m_pTip(nullptr),m_pCurrentTip(nullptr)
+m_pTip(nullptr),m_pCurrentTip(nullptr),m_CurrentAnimation(Tip::TipAnimation::None)
 {
    connect(parent, SIGNAL(sizeChanged(QRect,bool)) , this , \
SLOT(sizeChanged(QRect,bool)) );  connect(parent, SIGNAL(currentTipChanged(Tip*)) , \
                this , SLOT(currentChanged(Tip*))    );
diff --git a/src/lib/account.cpp b/src/lib/account.cpp
index 982284f..88fae80 100644
--- a/src/lib/account.cpp
+++ b/src/lib/account.cpp
@@ -533,7 +533,7 @@ void Account::setAccountDetails(const MapStringString& m)
 {
    if (m_pAccountDetails)
       delete m_pAccountDetails;
-   *m_pAccountDetails = m;
+   m_pAccountDetails = new MapStringString(m);
 }
 
 ///Set a specific detail
diff --git a/src/lib/callmodel.cpp b/src/lib/callmodel.cpp
index 3414909..6d88c30 100644
--- a/src/lib/callmodel.cpp
+++ b/src/lib/callmodel.cpp
@@ -37,7 +37,7 @@
 //Define
 ///InternalStruct: internal representation of a call
 struct InternalStruct {
-   InternalStruct() : m_pParent(nullptr){}
+   InternalStruct() : m_pParent(nullptr),call_real(nullptr),conference(false){}
    Call*                  call_real  ;
    QModelIndex            index      ;
    QList<InternalStruct*> m_lChildren;
diff --git a/src/widgets/categorizedtreeview.cpp \
b/src/widgets/categorizedtreeview.cpp index ba221ee..1204a0b 100644
--- a/src/widgets/categorizedtreeview.cpp
+++ b/src/widgets/categorizedtreeview.cpp
@@ -137,7 +137,6 @@ void CategorizedTreeView::startDrag(Qt::DropActions \
supportedActions)  QMimeData *data = model()->mimeData(list);
          if (!data)
             return;
-         
 
          //Execute the drag
          QDrag *drag = new QDrag(this);
diff --git a/src/widgets/tips/ringingtip.cpp b/src/widgets/tips/ringingtip.cpp
index 2217a4d..de01c37 100644
--- a/src/widgets/tips/ringingtip.cpp
+++ b/src/widgets/tips/ringingtip.cpp
@@ -34,8 +34,10 @@
 #include <cmath>
 
 ///Constructor
-RingingTip::RingingTip(QWidget* parent) : \
                Tip(QString(),parent),m_pTimer(nullptr),m_Counter(0)
-
+RingingTip::RingingTip(QWidget* parent) : \
Tip(QString(),parent),m_pTimer(nullptr),m_Counter(0), \
+m_phoneOriginalSVG(nullptr),m_ring1OriginalSVG(nullptr),m_ring2OriginalSVG(nullptr),m_ring3OriginalSVG(nullptr),
 +m_pPhoneR(nullptr),m_pRing1R(nullptr),m_pRing2R(nullptr),m_pRing3R(nullptr),m_pPhonePix(nullptr),m_pRing1Pix(nullptr),
 +m_pRing2Pix(nullptr)
 {
    setHasBackground(false);
    setHasText(false);


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic