Use FREE macro for freeing colors
Patch status: merged
Patch by Tony Crisci
Long description:
This macro will set the colors to NULL which avoids a double free on reload when colors that were unconfigured become configured. fixes #1299
To apply this patch, use:
curl http://cr.i3wm.org/patch/616/raw.patch | git am
b/i3bar/src/config.c
17 |
@@ -248,8 +248,7 @@ void parse_config_json(char *json) { |
18 |
void free_colors(struct xcb_color_strings_t *colors) { |
19 |
#define FREE_COLOR(x) \ |
20 |
do { \ |
21 |
- if (colors->x) \ |
22 |
- free(colors->x); \ |
23 |
+ FREE(colors->x); \ |
24 |
} while (0) |
25 |
FREE_COLOR(bar_fg); |
26 |
FREE_COLOR(bar_bg); |