macro: Fix memory leak expanding !DO loop over list.
authorBen Pfaff <blp@cs.stanford.edu>
Sat, 9 Oct 2021 16:32:02 +0000 (09:32 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Sat, 9 Oct 2021 16:32:02 +0000 (09:32 -0700)
Found by Address Sanitizer.

src/language/lexer/macro.c

index 62d060aad2ce21bc6320c0f05960f46051993cd4..bced649ec3b08481e352db101bd7b8410b6b3e26 100644 (file)
@@ -1836,6 +1836,7 @@ macro_expand_do (const struct macro_token *tokens, size_t n_tokens,
 
           macro_expand (p, do_end - p, &subme, exp);
         }
+      macro_tokens_uninit (&items);
       return do_end - tokens + 1;
     }
   else if (p < end && p->token.type == T_EQUALS)