]> git.sur5r.net Git - i3/i3/commitdiff
i3bar: Fix memory for old plain-text input (Thanks Han)
authorMichael Stapelberg <michael@stapelberg.de>
Mon, 19 Mar 2012 21:30:20 +0000 (22:30 +0100)
committerMichael Stapelberg <michael@stapelberg.de>
Mon, 19 Mar 2012 21:30:20 +0000 (22:30 +0100)
i3bar/src/child.c

index c98befba3a1ca694e24f6fcbc7b40bcf33361e2b..d5efa2aadc470303ff324a852135a19564fca4e0 100644 (file)
@@ -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';