changeset 29800:d2294eff5180

avoid memory leak for numeric token info in parser * token.cc (token::~token): Also delete m_num if token is numeric.
author John W. Eaton <jwe@octave.org>
date Tue, 22 Jun 2021 00:34:15 -0400
parents a91a58d85099
children 10408a66305b
files libinterp/parse-tree/token.cc
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/parse-tree/token.cc	Mon Jun 21 16:26:50 2021 -0400
+++ b/libinterp/parse-tree/token.cc	Tue Jun 22 00:34:15 2021 -0400
@@ -86,6 +86,8 @@
   {
     if (m_type_tag == string_token)
       delete m_tok_info.m_str;
+    else if (m_type_tag == numeric_token)
+      delete m_tok_info.m_num;
     else if (m_type_tag == scls_name_token)
       delete m_tok_info.m_superclass_info;
   }