From: Tony Crisci Date: Wed, 2 Jul 2014 03:17:02 +0000 (-0400) Subject: Use FREE macro for freeing colors X-Git-Tag: 4.9~80^2^2 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=0095ca8770c0f256cc46216f24e3c823d31b434d;p=i3%2Fi3 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 --- 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);