Use a proper union in struct config_item.

This allows me to use different types for the mutable, dynamically
allocated string value in a C_STRING control and the fixed constant
list of option names in a C_CHOICES.
This commit is contained in:
Simon Tatham
2017-10-01 13:38:35 +01:00
parent eeb2db283d
commit de67801b0f
51 changed files with 528 additions and 643 deletions

2
misc.c
View File

@ -17,7 +17,7 @@ void free_cfg(config_item *cfg)
for (i = cfg; i->type != C_END; i++)
if (i->type == C_STRING)
sfree(i->sval);
sfree(i->u.string.sval);
sfree(cfg);
}