It's a new year.
[sgt/putty] / config.c
index a03116b..87cff8c 100644 (file)
--- a/config.c
+++ b/config.c
@@ -131,12 +131,11 @@ void conf_filesel_handler(union control *ctrl, void *dlg,
     Conf *conf = (Conf *)data;
 
     if (event == EVENT_REFRESH) {
-       dlg_filesel_set(ctrl, dlg, *conf_get_filename(conf, key));
+       dlg_filesel_set(ctrl, dlg, conf_get_filename(conf, key));
     } else if (event == EVENT_VALCHANGE) {
-       Filename filename;
-       dlg_filesel_get(ctrl, dlg, &filename);
-       conf_set_filename(conf, key, &filename);
-       /* If Filenames ever become dynamic, free this one. */
+       Filename *filename = dlg_filesel_get(ctrl, dlg);
+       conf_set_filename(conf, key, filename);
+        filename_free(filename);
     }
 }
 
@@ -147,12 +146,11 @@ void conf_fontsel_handler(union control *ctrl, void *dlg,
     Conf *conf = (Conf *)data;
 
     if (event == EVENT_REFRESH) {
-       dlg_fontsel_set(ctrl, dlg, *conf_get_fontspec(conf, key));
+       dlg_fontsel_set(ctrl, dlg, conf_get_fontspec(conf, key));
     } else if (event == EVENT_VALCHANGE) {
-       FontSpec fontspec;
-       dlg_fontsel_get(ctrl, dlg, &fontspec);
-       conf_set_fontspec(conf, key, &fontspec);
-       /* If FontSpecs ever become dynamic, free this one. */
+       FontSpec *fontspec = dlg_fontsel_get(ctrl, dlg);
+       conf_set_fontspec(conf, key, fontspec);
+        fontspec_free(fontspec);
     }
 }