Просмотр исходного кода

cppcheck is right that the check for preventing null deference of Query
is redundant in Redirect() as we can't reach the code with null anyway

[apt-pkg/acquire-method.cc:433]: (error) Possible null pointer dereference:
Queue - otherwise it is redundant to check if Queue is null at line 425

David Kalnischkies лет назад: 15
Родитель
Сommit
b40b7c380a
1 измененных файлов с 2 добавлено и 6 удалено
  1. 2 6
      apt-pkg/acquire-method.cc

+ 2 - 6
apt-pkg/acquire-method.cc

@@ -421,12 +421,8 @@ void pkgAcqMethod::Status(const char *Format,...)
    to keep the pipeline synchronized. */
    to keep the pipeline synchronized. */
 void pkgAcqMethod::Redirect(const string &NewURI)
 void pkgAcqMethod::Redirect(const string &NewURI)
 {
 {
-   std::cout << "103 Redirect\nURI: ";
-   if (Queue != 0)
-      std::cout << Queue->Uri << "\n";
-   else
-      std::cout << "<UNKNOWN>\n";
-   std::cout << "New-URI: " << NewURI << "\n"
+   std::cout << "103 Redirect\nURI: " << Queue->Uri << "\n"
+	     << "New-URI: " << NewURI << "\n"
 	     << "\n" << std::flush;
 	     << "\n" << std::flush;
 
 
    // Change the URI for the request.
    // Change the URI for the request.