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
This commit is contained in:
parent
b5f3679a66
commit
0095ca8770
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user