summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2010-01-18 08:02:05 +0100
committerJim Meyering <meyering@redhat.com>2010-01-18 12:03:18 +0100
commit31423c76e8e6885659141535a2a5fd9e3b4c503e (patch)
tree520b102be78f71479253d5e0eb12bbed3d84bf78 /src
parentcd349fdca2f3368d1c2441a432dda2f064e4c455 (diff)
downloadcoreutils-31423c76e8e6885659141535a2a5fd9e3b4c503e.tar.xz
libstdbuf: plug a very unlikely leak
* src/libstdbuf.c (apply_mode): Don't leak "buf" upon setvbuf failure.
Diffstat (limited to 'src')
-rw-r--r--src/libstdbuf.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/libstdbuf.c b/src/libstdbuf.c
index 2ef848f86..50eebb12c 100644
--- a/src/libstdbuf.c
+++ b/src/libstdbuf.c
@@ -123,6 +123,7 @@ apply_mode (FILE *stream, const char *mode)
{
fprintf (stderr, _("could not set buffering of %s to mode %s\n"),
fileno_to_name (fileno (stream)), mode);
+ free (buf);
}
}