From 6fd348021a974d5ba97342a00ae3f054077d9b42 Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 7 Dec 2018 16:48:21 +0000 Subject: 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 --- mjit.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'mjit.c') diff --git a/mjit.c b/mjit.c index 0f4b9fddc6..e94f2d9443 100644 --- a/mjit.c +++ b/mjit.c @@ -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; -- cgit v1.2.3