Fix memory leak when failed to build pch path

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66277 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2018-12-07 16:48:21 +00:00
parent 42ab1fd2a6
commit 6fd348021a

5
mjit.c
View File

@ -456,8 +456,11 @@ init_header_filename(void)
}
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;