Fix dangerous iterator use.
authorRichard Kreckel <kreckel@ginac.de>
Tue, 18 May 2010 22:18:35 +0000 (00:18 +0200)
committerRichard Kreckel <kreckel@ginac.de>
Tue, 18 May 2010 22:18:35 +0000 (00:18 +0200)
This was detected by cppcheck and reported by Martin Ettl <ettl.martin@gmx.de>.

ginac/excompiler.cpp

index 8d6670f..80e4dd1 100644 (file)
@@ -172,7 +172,7 @@ public:
                for (std::vector<filedesc>::iterator it = filelist.begin(); it != filelist.end();) {
                        if (it->name == filename) {
                                clean_up(it);
-                               filelist.erase(it);
+                               it = filelist.erase(it);
                        } else {
                                ++it;
                        }