summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y5
1 files changed, 4 insertions, 1 deletions
diff --git a/parse.y b/parse.y
index f51e8a4b92..00b1a4cba9 100644
--- a/parse.y
+++ b/parse.y
@@ -6458,7 +6458,10 @@ parser_here_document(struct parser_params *parser, NODE *here)
if (pend < lex_pend) rb_str_cat(str, "\n", 1);
lex_goto_eol(parser);
if (nextc() == -1) {
- if (str) dispose_string(str);
+ if (str) {
+ dispose_string(str);
+ str = 0;
+ }
goto error;
}
} while (!whole_match_p(eos, len, indent));