From: shdown Date: Tue, 2 Jun 2015 20:08:08 +0000 (+0300) Subject: i3bar: fix freeing static strings X-Git-Tag: 4.11~98^2 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=fe006f0f6a16199a623f2ed5ddb182b72169aa01;p=i3%2Fi3 i3bar: fix freeing static strings name and color fields of blocks are freed in clear_statusline, so they need to be strdup'ed. --- diff --git a/i3bar/src/child.c b/i3bar/src/child.c index e5ce209d..e369c54d 100644 --- a/i3bar/src/child.c +++ b/i3bar/src/child.c @@ -107,14 +107,14 @@ __attribute__((format(printf, 1, 2))) static void set_statusline_error(const cha struct status_block *err_block = scalloc(sizeof(struct status_block)); err_block->full_text = i3string_from_utf8("Error: "); - err_block->name = "error"; - err_block->color = "red"; + err_block->name = sstrdup("error"); + err_block->color = sstrdup("red"); err_block->no_separator = true; struct status_block *message_block = scalloc(sizeof(struct status_block)); message_block->full_text = i3string_from_utf8(message); - message_block->name = "error_message"; - message_block->color = "red"; + message_block->name = sstrdup("error_message"); + message_block->color = sstrdup("red"); message_block->no_separator = true; TAILQ_INSERT_HEAD(&statusline_head, err_block, blocks);