bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] libstdbuf: plug a leak


From: Jim Meyering
Subject: [PATCH] libstdbuf: plug a leak
Date: Mon, 18 Jan 2010 08:02:57 +0100

Hi Pádraig,

Is this ok with you?

>From 175c6320d2934a48e7bd31b2a778758a8c1c1ae4 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Mon, 18 Jan 2010 08:02:05 +0100
Subject: [PATCH] libstdbuf: plug a leak

* src/libstdbuf.c (apply_mode): Don't leak "buf" upon setvbuf failure.
---
 src/libstdbuf.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/libstdbuf.c b/src/libstdbuf.c
index 2ef848f..50eebb1 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);
     }
 }

--
1.6.6.638.g2bc54




reply via email to

[Prev in Thread] Current Thread [Next in Thread]