Don't leak memory when compiling text following the a', c' or `i' command.

Testcase:

echo FOO | sed "/FOO/c\\
`jot -b 'aaaa\' 500`"

Submitted by:	Max Khon <fjoe@newst.net>
This commit is contained in:
Ruslan Ermilov 2001-05-18 09:48:17 +00:00
parent b36a733b6e
commit 94ccf5741c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=76804

View File

@ -653,7 +653,7 @@ compile_text()
}
if (asize - size < _POSIX2_LINE_MAX + 1) {
asize *= 2;
text = xmalloc(asize);
text = xrealloc(text, asize);
}
}
text[size] = '\0';