From 4b8298581217a1928e739bb99afc9a4a65189569 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Thu, 25 Oct 2001 12:24:21 +0000 Subject: Fix segfault on \W{URL}\cw{link text} construction. [originally from svn r1321] --- input.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'input.c') diff --git a/input.c b/input.c index 481c2cb..7f313a6 100644 --- a/input.c +++ b/input.c @@ -978,6 +978,8 @@ static void read_file(paragraph ***ret, input *in, index *idx) { /* * Special cases: \W{}\c, \W{}\e, \W{}\cw */ + sitem = mknew(struct stack_item); + sitem->type = stack_hyper; if (t.type == tok_cmd && (t.cmd == c_e || t.cmd == c_c || t.cmd == c_cw)) { if (style != word_Normal) @@ -993,9 +995,8 @@ static void read_file(paragraph ***ret, input *in, index *idx) { } if (t.type != tok_lbrace) { error(err_explbr, &t.pos); + sfree(sitem); } else { - sitem = mknew(struct stack_item); - sitem->type = stack_hyper; stk_push(parsestk, sitem); } } -- cgit v1.1