]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
libstdbuf: plug a very unlikely leak
authorJim Meyering <meyering@redhat.com>
Mon, 18 Jan 2010 07:02:05 +0000 (08:02 +0100)
committerJim Meyering <meyering@redhat.com>
Mon, 18 Jan 2010 11:03:18 +0000 (12:03 +0100)
* src/libstdbuf.c (apply_mode): Don't leak "buf" upon setvbuf failure.

src/libstdbuf.c

index 2ef848f86b3b2a7cf398ccfe09301e39c8ed63df..50eebb12c0370eef88d64746d0cef1fd30833aff 100644 (file)
@@ -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);
     }
 }