]> git.mdlowis.com Git - proto/sclpl.git/commitdiff
Set the token to null after freeing
authorMichael D. Lowis <mike@mdlowis.com>
Thu, 2 Oct 2014 01:06:40 +0000 (21:06 -0400)
committerMichael D. Lowis <mike@mdlowis.com>
Thu, 2 Oct 2014 01:06:40 +0000 (21:06 -0400)
source/sclpl/parser.c

index 93175943d13c7bf14cd9ad91ce47fe6f07701f81..57362a8786dbd0e8a1499a8b71cacf786a8c2806 100644 (file)
@@ -62,8 +62,10 @@ bool parser_eof(parser_t* p_parser) {
 }
 
 void parser_resume(parser_t* p_parser) {
-    if (NULL != p_parser->p_tok)
+    if (NULL != p_parser->p_tok) {
         mem_release(p_parser->p_tok);
+        p_parser->p_tok = NULL;
+    }
     vec_clear(p_parser->p_tok_buf);
     lexer_skipline(p_parser->p_lexer);
 }