Index: variable.c
===================================================================
--- variable.c	(revision 37568036c0ce28a8a062bb841e32c1acad143bc5)
+++ variable.c	(revision 81a56862855d50cfb29bc300c780a0d1b542d1ae)
@@ -7,29 +7,29 @@
 
 #define OWLVAR_BOOL(name,default,summary,description) \
-        { name, OWL_VARIABLE_BOOL, NULL, default, "on,off", summary,description, NULL, \
+        { g_strdup(name), OWL_VARIABLE_BOOL, NULL, default, "on,off", g_strdup(summary), g_strdup(description), NULL, \
         NULL, NULL, NULL, NULL, NULL, NULL }
 
 #define OWLVAR_BOOL_FULL(name,default,summary,description,validate,set,get) \
-        { name, OWL_VARIABLE_BOOL, NULL, default, "on,off", summary,description, NULL, \
+        { g_strdup(name), OWL_VARIABLE_BOOL, NULL, default, "on,off", g_strdup(summary), g_strdup(description), NULL, \
         validate, set, NULL, get, NULL, NULL }
 
 #define OWLVAR_INT(name,default,summary,description) \
-        { name, OWL_VARIABLE_INT, NULL, default, "<int>", summary,description, NULL, \
+        { g_strdup(name), OWL_VARIABLE_INT, NULL, default, "<int>", g_strdup(summary), g_strdup(description), NULL, \
         NULL, NULL, NULL, NULL, NULL, NULL }
 
 #define OWLVAR_INT_FULL(name,default,summary,description,validset,validate,set,get) \
-        { name, OWL_VARIABLE_INT, NULL, default, validset, summary,description, NULL, \
+        { g_strdup(name), OWL_VARIABLE_INT, NULL, default, validset, g_strdup(summary), g_strdup(description), NULL, \
         validate, set, NULL, get, NULL, NULL }
 
 #define OWLVAR_PATH(name,default,summary,description) \
-        { name, OWL_VARIABLE_STRING, default, 0, "<path>", summary,description,  NULL, \
+        { g_strdup(name), OWL_VARIABLE_STRING, g_strdup(default), 0, "<path>", g_strdup(summary), g_strdup(description),  NULL, \
         NULL, NULL, NULL, NULL, NULL, NULL }
 
 #define OWLVAR_STRING(name,default,summary,description) \
-        { name, OWL_VARIABLE_STRING, default, 0, "<string>", summary,description, NULL, \
+        { g_strdup(name), OWL_VARIABLE_STRING, g_strdup(default), 0, "<string>", g_strdup(summary), g_strdup(description), NULL, \
         NULL, NULL, NULL, NULL, NULL, NULL }
 
 #define OWLVAR_STRING_FULL(name,default,validset,summary,description,validate,set,get) \
-        { name, OWL_VARIABLE_STRING, default, 0, validset, summary,description, NULL, \
+        { g_strdup(name), OWL_VARIABLE_STRING, g_strdup(default), 0, validset, g_strdup(summary), g_strdup(description), NULL, \
         validate, set, NULL, get, NULL, NULL }
 
@@ -38,5 +38,5 @@
  * correspond to the values that may be specified. */
 #define OWLVAR_ENUM(name,default,summary,description,validset) \
-        { name, OWL_VARIABLE_INT, NULL, default, validset, summary,description, NULL, \
+        { g_strdup(name), OWL_VARIABLE_INT, NULL, default, validset, g_strdup(summary), g_strdup(description), NULL, \
         owl_variable_enum_validate, \
         NULL, owl_variable_enum_set_fromstring, \
@@ -45,5 +45,5 @@
 
 #define OWLVAR_ENUM_FULL(name,default,summary,description,validset,validate, set, get) \
-        { name, OWL_VARIABLE_INT, NULL, default, validset, summary,description, NULL, \
+        { g_strdup(name), OWL_VARIABLE_INT, NULL, default, validset, g_strdup(summary), g_strdup(description), NULL, \
         validate, \
         set, owl_variable_enum_set_fromstring, \
@@ -443,5 +443,9 @@
   };
 
-  return owl_variable_dict_add_from_list(vd, variables_to_init);
+  int ret = owl_variable_dict_add_from_list(vd, variables_to_init);
+  owl_variable *var;
+  for (var = variables_to_init; var->name != NULL; var++)
+    owl_variable_cleanup(var);
+  return ret;
 }
 
@@ -729,5 +733,5 @@
 }
 
-void owl_variable_delete(owl_variable *v)
+void owl_variable_cleanup(owl_variable *v)
 {
   if (v->delete_fn) v->delete_fn(v);
@@ -737,4 +741,9 @@
   if (v->type == OWL_VARIABLE_STRING)
     g_free(v->pval_default);
+}
+
+void owl_variable_delete(owl_variable *v)
+{
+  owl_variable_cleanup(v);
   g_free(v);
 }
