summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2004-04-20 06:50:37 +0000
committerJim Meyering <jim@meyering.net>2004-04-20 06:50:37 +0000
commitffccc03ad87b5082dd0bb63616777b830b71a423 (patch)
treea4d58940de2b805dbb9740efae9d3eb75ec74680
parent58e94308f5c9cc5f6f4b0bd31117704da7b4260e (diff)
downloadcoreutils-ffccc03ad87b5082dd0bb63616777b830b71a423.tar.xz
(cut_fields): Free buffer upon getndelim2 failure.
-rw-r--r--src/cut.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/cut.c b/src/cut.c
index 83fd4efc4..e060bbd21 100644
--- a/src/cut.c
+++ b/src/cut.c
@@ -584,6 +584,7 @@ cut_fields (FILE *stream)
stream, delim, '\n', 0);
if (len < 0)
{
+ free (field_1_buffer);
if (ferror (stream) || feof (stream))
break;
xalloc_die ();