public inbox for util-linux@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] lib/colors: remove memory leak
@ 2014-07-16 20:54 Sami Kerola
  2014-07-16 20:54 ` [PATCH 2/3] fallocate: avoid unnecessary computation Sami Kerola
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Sami Kerola @ 2014-07-16 20:54 UTC (permalink / raw)
  To: util-linux; +Cc: kerolasa

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
---
 lib/colors.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/colors.c b/lib/colors.c
index cb342a0..8de1d2f 100644
--- a/lib/colors.c
+++ b/lib/colors.c
@@ -425,9 +425,9 @@ static int colors_add_scheme(struct ul_color_ctl *cc,
 		return -EINVAL;
 
 	rc = cn_sequence(seq0, &seq);
+	free(seq0);
 	if (rc)
 		return rc;
-	free(seq0);
 
 	/* convert logical name (e.g. "red") to real ESC code */
 	if (isalpha(*seq)) {
-- 
2.0.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-07-17 12:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-16 20:54 [PATCH 1/3] lib/colors: remove memory leak Sami Kerola
2014-07-16 20:54 ` [PATCH 2/3] fallocate: avoid unnecessary computation Sami Kerola
2014-07-16 20:54 ` [PATCH 3/3] fstrim: avoid TOCTOU race Sami Kerola
2014-07-17 12:02 ` [PATCH 1/3] lib/colors: remove memory leak Karel Zak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox