summaryrefslogtreecommitdiffstats
path: root/usr.bin/sed
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>2001-05-18 09:48:17 +0000
committerru <ru@FreeBSD.org>2001-05-18 09:48:17 +0000
commit4048b83188d3a777f80f9362dba2609ad5cd7903 (patch)
treef0530a8ead0201520c75770ddb008e658c0d0ccd /usr.bin/sed
parented0f313004c334b1f686be02b9031b0a8142abc4 (diff)
downloadFreeBSD-src-4048b83188d3a777f80f9362dba2609ad5cd7903.zip
FreeBSD-src-4048b83188d3a777f80f9362dba2609ad5cd7903.tar.gz
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>
Diffstat (limited to 'usr.bin/sed')
-rw-r--r--usr.bin/sed/compile.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.bin/sed/compile.c b/usr.bin/sed/compile.c
index 0fb5cca..606db89 100644
--- a/usr.bin/sed/compile.c
+++ b/usr.bin/sed/compile.c
@@ -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';
OpenPOWER on IntegriCloud