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

ruby-changes:49269

From: nobu <ko1@a...>
Date: Thu, 21 Dec 2017 16:59:05 +0900 (JST)
Subject: [ruby-changes:49269] nobu:r61386 (trunk): string.c: fix memory leak

nobu	2017-12-21 16:59:00 +0900 (Thu, 21 Dec 2017)

  New Revision: 61386

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

  Log:
    string.c: fix memory leak

  Modified files:
    trunk/string.c
Index: string.c
===================================================================
--- string.c	(revision 61385)
+++ string.c	(revision 61386)
@@ -6287,6 +6287,7 @@ str_undump(VALUE str) https://github.com/ruby/ruby/blob/trunk/string.c#L6287
 		memcpy(buf, encname, size);
 		buf[size] = '\0';
 		encidx = rb_enc_find_index(buf);
+		xfree(buf);
 		if (encidx < 0) {
 		    rb_raise(rb_eRuntimeError, "dumped string has unknown encoding name");
 		}

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

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