chiark / gitweb /
Game configuration box for Windows, by constructing the dialog box
[sgt-puzzles.git] / misc.c
diff --git a/misc.c b/misc.c
index 58c4fb7d8a1f5385cc30956c0f7dd7f24d6c025d..48088da140d3edb011222511bdff33cbd6150f24 100644 (file)
--- a/misc.c
+++ b/misc.c
@@ -23,3 +23,13 @@ int rand_upto(int limit)
 
     return (int)n;
 }
+
+void free_cfg(config_item *cfg)
+{
+    config_item *i;
+
+    for (i = cfg; i->type != C_END; i++)
+       if (i->type == C_STRING)
+           sfree(i->sval);
+    sfree(cfg);
+}