From 0095ca8770c0f256cc46216f24e3c823d31b434d Mon Sep 17 00:00:00 2001 From: Tony Crisci Date: Tue, 1 Jul 2014 23:17:02 -0400 Subject: [PATCH] Use FREE macro for freeing colors This macro will set the colors to NULL which avoids a double free on reload when colors that were unconfigured become configured. fixes #1299 --- i3bar/src/config.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/i3bar/src/config.c b/i3bar/src/config.c index 1f0c2a8e..809b1ab4 100644 --- a/i3bar/src/config.c +++ b/i3bar/src/config.c @@ -248,8 +248,7 @@ void parse_config_json(char *json) { void free_colors(struct xcb_color_strings_t *colors) { #define FREE_COLOR(x) \ do { \ - if (colors->x) \ - free(colors->x); \ + FREE(colors->x); \ } while (0) FREE_COLOR(bar_fg); FREE_COLOR(bar_bg);