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

ruby-changes:17799

From: naruse <ko1@a...>
Date: Wed, 17 Nov 2010 09:51:59 +0900 (JST)
Subject: [ruby-changes:17799] Ruby:r29810 (trunk): * enc/shift_jis.c (property_name_to_ctype): fix memory leak.

naruse	2010-11-17 09:49:49 +0900 (Wed, 17 Nov 2010)

  New Revision: 29810

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

  Log:
    * enc/shift_jis.c (property_name_to_ctype): fix memory leak.
    
    * enc/euc_jp.c (property_name_to_ctype): ditto.

  Modified files:
    trunk/ChangeLog
    trunk/enc/euc_jp.c
    trunk/enc/shift_jis.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 29809)
+++ ChangeLog	(revision 29810)
@@ -1,3 +1,9 @@
+Wed Nov 17 09:49:10 2010  NARUSE, Yui  <naruse@r...>
+
+	* enc/shift_jis.c (property_name_to_ctype): fix memory leak.
+
+	* enc/euc_jp.c (property_name_to_ctype): ditto.
+
 Tue Nov 17 08:54:04 2010  James Edward Gray II  <jeg2@r...>
 
 	* lib/csv.rb: Upgrading output encoding as needed.  [ruby-core:33135]
Index: enc/euc_jp.c
===================================================================
--- enc/euc_jp.c	(revision 29809)
+++ enc/euc_jp.c	(revision 29810)
@@ -290,7 +290,7 @@
 
   PROPERTY_LIST_INIT_CHECK;
 
-  s = e = ALLOC_N(UChar, end-p+1);
+  s = e = ALLOCA_N(UChar, end-p+1);
   for (; p < end; p++) {
     *e++ = ONIGENC_ASCII_CODE_TO_LOWER_CASE(*p);
   }
Index: enc/shift_jis.c
===================================================================
--- enc/shift_jis.c	(revision 29809)
+++ enc/shift_jis.c	(revision 29810)
@@ -299,7 +299,7 @@
 
   PROPERTY_LIST_INIT_CHECK;
 
-  s = e = ALLOC_N(UChar, end-p+1);
+  s = e = ALLOCA_N(UChar, end-p+1);
   for (; p < end; p++) {
     *e++ = ONIGENC_ASCII_CODE_TO_LOWER_CASE(*p);
   }

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

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