From: Michael Stapelberg Date: Mon, 19 Mar 2012 21:30:20 +0000 (+0100) Subject: i3bar: Fix memory for old plain-text input (Thanks Han) X-Git-Tag: 4.2~51 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=607ba6fcde36a710c08202c7155b7b64a6c99819;p=i3%2Fi3 i3bar: Fix memory for old plain-text input (Thanks Han) --- 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';