]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/contrib/error.cc
if multi-arch is detected ensure that pkg:all is reported as pkg:all
[apt.git] / apt-pkg / contrib / error.cc
index fe50e606b6fd2a33e45716d8e0962dd06447d053..122e2c8098eb6b063b87bdbcc0ef576b3bbc2c8c 100644 (file)
@@ -13,6 +13,8 @@
    ##################################################################### */
                                                                        /*}}}*/
 // Include Files                                                       /*{{{*/
+#include <config.h>
+
 #include <apt-pkg/error.h>
 
 #include <iostream>
@@ -24,8 +26,7 @@
 #include <string>
 #include <cstring>
 
-#include "config.h"
-                                                                       /*}}}*/
+                                                                       /*}}}*/
 
 // Global Error Object                                                 /*{{{*/
 /* If the implementation supports posix threads then the accessor function
@@ -107,6 +108,7 @@ bool GlobalError::InsertErrno(MsgType type, const char* Function,
                        msgSize = n + 1;
                else
                        msgSize *= 2;
+               free(S);
                return true;
        }
 
@@ -160,6 +162,7 @@ bool GlobalError::Insert(MsgType type, const char* Description,
                        msgSize = n + 1;
                else
                        msgSize *= 2;
+               free(S);
                return true;
        }
 
@@ -191,7 +194,7 @@ bool GlobalError::PopMessage(std::string &Text) {
 
        // check if another error message is pending
        for (std::list<Item>::const_iterator m = Messages.begin();
-            m != Messages.end(); m++)
+            m != Messages.end(); ++m)
                if (m->Type == ERROR || m->Type == FATAL)
                        return Ret;
 
@@ -208,7 +211,7 @@ void GlobalError::DumpErrors(std::ostream &out, MsgType const &threshold,
                        Messages.insert(Messages.begin(), s->Messages.begin(), s->Messages.end());
 
        for (std::list<Item>::const_iterator m = Messages.begin();
-            m != Messages.end(); m++)
+            m != Messages.end(); ++m)
                if (m->Type >= threshold)
                        out << (*m) << std::endl;
        Discard();
@@ -229,7 +232,7 @@ bool GlobalError::empty(MsgType const &trashhold) const {
                return true;
 
        for (std::list<Item>::const_iterator m = Messages.begin();
-            m != Messages.end(); m++)
+            m != Messages.end(); ++m)
                if (m->Type >= trashhold)
                        return false;