From 607ba6fcde36a710c08202c7155b7b64a6c99819 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Mon, 19 Mar 2012 22:30:20 +0100 Subject: [PATCH] i3bar: Fix memory for old plain-text input (Thanks Han) --- i3bar/src/child.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/i3bar/src/child.c b/i3bar/src/child.c index c98befba..d5efa2aa 100644 --- a/i3bar/src/child.c +++ b/i3bar/src/child.c @@ -213,6 +213,8 @@ void stdin_io_cb(struct ev_loop *loop, ev_io *watcher, int revents) { free(buffer); } else { struct status_block *first = TAILQ_FIRST(&statusline_head); + /* Clear the old buffer if any. */ + FREE(first->full_text); /* Remove the trailing newline and terminate the string at the same * time. */ buffer[rec-1] = '\0'; -- 2.39.5