From f974b5d15f92a4b63ef4ee393f70b92647034082 Mon Sep 17 00:00:00 2001 From: Paul Harrison Date: Sun, 9 Jun 2013 10:08:28 +0100 Subject: [PATCH] MythNews: Fix coverity ID 1026735 Uninitialized pointer field In MythNews::MythNews(): Several fields are not initialized in the constructor. --- mythplugins/mythnews/mythnews/mythnews.cpp | 38 ++++++++++++---------- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/mythplugins/mythnews/mythnews/mythnews.cpp b/mythplugins/mythnews/mythnews/mythnews.cpp index cdeaf82d074..b829f18f384 100644 --- a/mythplugins/mythnews/mythnews/mythnews.cpp +++ b/mythplugins/mythnews/mythnews/mythnews.cpp @@ -45,7 +45,26 @@ */ MythNews::MythNews(MythScreenStack *parent, const QString &name) : MythScreenType(parent, name), - m_lock(QMutex::Recursive) + m_lock(QMutex::Recursive), + m_RetrieveTimer(new QTimer(this)), + m_TimerTimeout(10*60*1000), + m_UpdateFreq(gCoreContext->GetNumSetting("NewsUpdateFrequency", 30)), + m_zoom(gCoreContext->GetSetting("WebBrowserZoomLevel", "1.0")), + m_browser(gCoreContext->GetSetting("WebBrowserCommand", "")), + m_menuPopup(NULL), + m_progressPopup(NULL), + m_httpGrabber(NULL), + m_abortHttp(false), + m_sitesList(NULL), + m_articlesList(NULL), + m_nositesText(NULL), + m_updatedText(NULL), + m_titleText(NULL), + m_descText(NULL), + m_thumbnailImage(NULL), + m_downloadImage(NULL), + m_enclosureImage(NULL), + m_podcastImage(NULL) { // Setup cache directory @@ -59,25 +78,8 @@ MythNews::MythNews(MythScreenStack *parent, const QString &name) : if (!dir.exists()) dir.mkdir(fileprefix); - m_zoom = gCoreContext->GetSetting("WebBrowserZoomLevel", "1.0"); - m_browser = gCoreContext->GetSetting("WebBrowserCommand", ""); - - // Initialize variables - - m_sitesList = m_articlesList = NULL; - m_updatedText = m_titleText = m_descText = NULL; - m_thumbnailImage = m_downloadImage = m_enclosureImage = NULL; - m_menuPopup = NULL; - m_progressPopup = NULL; - - m_TimerTimeout = 10*60*1000; - m_httpGrabber = NULL; - - // Now do the actual work - m_RetrieveTimer = new QTimer(this); connect(m_RetrieveTimer, SIGNAL(timeout()), this, SLOT(slotRetrieveNews())); - m_UpdateFreq = gCoreContext->GetNumSetting("NewsUpdateFrequency", 30); m_RetrieveTimer->stop(); m_RetrieveTimer->setSingleShot(false);