summaryrefslogtreecommitdiff
path: root/input.c
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2001-10-25 12:24:21 +0000
committerSimon Tatham <anakin@pobox.com>2001-10-25 12:24:21 +0000
commit4b8298581217a1928e739bb99afc9a4a65189569 (patch)
treebadb8860df1e9b64783c5ac5afa14ea9b6fe1a2d /input.c
parenta8cf7617bb5180d5535021a31f68c558473443f0 (diff)
downloadhalibut-4b8298581217a1928e739bb99afc9a4a65189569.zip
halibut-4b8298581217a1928e739bb99afc9a4a65189569.tar.gz
halibut-4b8298581217a1928e739bb99afc9a4a65189569.tar.bz2
halibut-4b8298581217a1928e739bb99afc9a4a65189569.tar.xz
Fix segfault on \W{URL}\cw{link text} construction.
[originally from svn r1321]
Diffstat (limited to 'input.c')
-rw-r--r--input.c5
1 files changed, 3 insertions, 2 deletions
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);
}
}