Skip to content
This repository
Browse code

Merge pull request #1856 from kylhill/master

Fix Remaining Coverity Static Analysis Warnings in XBMC
  • Loading branch information...
commit b6c393b1d79d0c70d75e84f02e0950550959069a 2 parents 8f0d270 + 9dbe48d
jmarshallnz authored November 29, 2012
4  xbmc/dialogs/GUIDialogMediaSource.cpp
@@ -165,8 +165,7 @@ bool CGUIDialogMediaSource::ShowAndAddMediaSource(const CStdString &type)
165 165
 
166 166
 bool CGUIDialogMediaSource::ShowAndEditMediaSource(const CStdString &type, const CStdString&share)
167 167
 {
168  
-  VECSOURCES* pShares=NULL;
169  
-
  168
+  VECSOURCES* pShares = g_settings.GetSourcesFromType(type);
170 169
   if (pShares)
171 170
   {
172 171
     for (unsigned int i=0;i<pShares->size();++i)
@@ -175,7 +174,6 @@ bool CGUIDialogMediaSource::ShowAndEditMediaSource(const CStdString &type, const
175 174
         return ShowAndEditMediaSource(type,(*pShares)[i]);
176 175
     }
177 176
   }
178  
-
179 177
   return false;
180 178
 }
181 179
 
4  xbmc/interfaces/legacy/CallbackHandler.cpp
@@ -145,11 +145,11 @@ namespace XBMCAddon
145 145
 #ifdef ENABLE_TRACE_API
146 146
         CLog::Log(LOGDEBUG,"%sNEWADDON removing callback 0x%lx for PyThreadState 0x%lx from queue", _tg.getSpaces(),(long)(p->cb.get()) ,(long)userData);
147 147
 #endif
148  
-        g_callQueue.erase(iter);
  148
+        iter = g_callQueue.erase(iter);
149 149
       }
150 150
       else
151 151
         iter++;
152  
-    }  
  152
+    }
153 153
   }
154 154
 }
155 155
 
1  xbmc/music/tags/TagLoaderTagLib.cpp
@@ -152,6 +152,7 @@ bool CTagLoaderTagLib::Load(const string& strFileName, CMusicInfoTag& tag, Embed
152 152
     if (!file || !file->isValid())
153 153
     {
154 154
       delete file;
  155
+      oggFlacFile = NULL;
155 156
       file = oggVorbisFile = new Ogg::Vorbis::File(stream);
156 157
     }
157 158
   }
4  xbmc/network/WebServer.cpp
@@ -395,7 +395,11 @@ int CWebServer::CreateFileDownloadResponse(struct MHD_Connection *connection, co
395 395
                                                      &CWebServer::ContentReaderCallback, file,
396 396
                                                      &CWebServer::ContentReaderFreeCallback);
397 397
       if (response == NULL)
  398
+      {
  399
+        file->Close();
  400
+        delete file;
398 401
         return MHD_NO;
  402
+      }
399 403
     }
400 404
     else
401 405
     {
2  xbmc/network/linux/ZeroconfAvahi.cpp
@@ -387,7 +387,7 @@ void CZeroconfAvahi::addService(tServiceMap::mapped_type fp_service_info, AvahiC
387 387
   {
388 388
     if ((ret = avahi_entry_group_add_service_strlst(fp_service_info->mp_group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, AvahiPublishFlags(0),
389 389
                                              fp_service_info->m_name.c_str(),
390  
-                                             fp_service_info->m_type.c_str(), NULL, NULL, fp_service_info->m_port, fp_service_info->mp_txt) < 0))
  390
+                                             fp_service_info->m_type.c_str(), NULL, NULL, fp_service_info->m_port, fp_service_info->mp_txt)) < 0)
391 391
     {
392 392
       if (ret == AVAHI_ERR_COLLISION)
393 393
       {
3  xbmc/utils/BitstreamConverter.cpp
@@ -535,7 +535,10 @@ void CBitstreamConverter::Close(void)
535 535
       m_sps_pps_context.sps_pps_data = NULL;
536 536
     }
537 537
     if(m_convertBuffer)
  538
+    {
538 539
       free(m_convertBuffer);
  540
+      m_convertBuffer = NULL;
  541
+    }
539 542
     m_convertSize       = 0;
540 543
   }
541 544
 

0 notes on commit b6c393b

Please sign in to comment.
Something went wrong with that request. Please try again.