ruby-changes:54058
From: nobu <ko1@a...>
Date: Sat, 8 Dec 2018 01:48:26 +0900 (JST)
Subject: [ruby-changes:54058] nobu:r66277 (trunk): Fix memory leak when failed to build pch path
nobu 2018-12-08 01:48:21 +0900 (Sat, 08 Dec 2018) New Revision: 66277 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=66277 Log: Fix memory leak when failed to build pch path Modified files: trunk/mjit.c Index: mjit.c =================================================================== --- mjit.c (revision 66276) +++ mjit.c (revision 66277) @@ -456,8 +456,11 @@ init_header_filename(void) https://github.com/ruby/ruby/blob/trunk/mjit.c#L456 } pch_file = get_uniq_filename(0, MJIT_TMP_PREFIX "h", ".h.gch"); - if (pch_file == NULL) + if (pch_file == NULL) { + xfree(header_file); + header_file = NULL; return FALSE; + } #else { static const char pch_name[] = MJIT_PRECOMPILED_HEADER_NAME; -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/