[前][次][番号順一覧][スレッド一覧]

ruby-changes:39900

From: nobu <ko1@a...>
Date: Wed, 30 Sep 2015 01:35:00 +0900 (JST)
Subject: [ruby-changes:39900] nobu:r51981 (trunk): parse.y: fix memory leak

nobu	2015-09-30 01:34:37 +0900 (Wed, 30 Sep 2015)

  New Revision: 51981

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=51981

  Log:
    parse.y: fix memory leak
    
    * parse.y (parser_free): fix memory leak at syntax error when
      warn-indent is enabled.

  Modified files:
    trunk/ChangeLog
    trunk/parse.y
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 51980)
+++ ChangeLog	(revision 51981)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Wed Sep 30 01:34:34 2015  Nobuyoshi Nakada  <nobu@r...>
+
+	* parse.y (parser_free): fix memory leak at syntax error when
+	  warn-indent is enabled.
+
 Tue Sep 29 22:27:50 2015  Benoit Daloze  <eregontp@g...>
 
 	* parse.y: fix minor typo. [ci skip][fix GH-1038].
Index: parse.y
===================================================================
--- parse.y	(revision 51980)
+++ parse.y	(revision 51981)
@@ -10630,6 +10630,15 @@ parser_free(void *ptr) https://github.com/ruby/ruby/blob/trunk/parse.y#L10630
 	prev = local->prev;
 	xfree(local);
     }
+#ifndef RIPPER
+    {
+	token_info *ptinfo;
+	while ((ptinfo = parser->token_info) != 0) {
+	    parser->token_info = ptinfo->next;
+	    xfree(ptinfo);
+	}
+    }
+#endif
     xfree(ptr);
 }
 

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]