- Fix memleak (read buffer in scanner)
authorhelly <helly@642ea486-5414-0410-9d7f-a0204ed87703>
Mon, 5 Jun 2006 22:05:52 +0000 (22:05 +0000)
committerhelly <helly@642ea486-5414-0410-9d7f-a0204ed87703>
Mon, 5 Jun 2006 22:05:52 +0000 (22:05 +0000)
re2c/scanner.h
re2c/scanner.re

index 9f7fb95892a0b028e8ab73fd875d3b4fe532f8fc..8de61e76f9c7cc00fa774c2e42468a82e2570893 100644 (file)
@@ -27,6 +27,8 @@ private:
 
 public:
        Scanner(std::istream&, std::ostream&);
+       ~Scanner();
+
        int echo();
        int scan();
        
index 3f0cc30b128187694b8beab270e9d7548eb5f8c3..90a9b9560332b4001429716443b2245db9cf521f 100644 (file)
@@ -357,5 +357,12 @@ void Scanner::fatal(uint ofs, const char *msg) const
        exit(1);
 }
 
-} // end namespace re2c
+Scanner::~Scanner()
+{
+       if (bot)
+       {
+               delete [] bot;
+       }
+}
 
+} // end namespace re2c