+ xfree(f->name);
+}
+
+/* --- @key_close@ --- *
+ *
+ * Arguments: @key_file *f@ = pointer to key file block
+ *
+ * Returns: A @KWRITE_@ code indicating how it went.
+ *
+ * Use: Frees all the key data, writes any changes. Make sure that
+ * all hell breaks loose if this returns @KWRITE_BROKEN@.
+ */
+
+int key_close(key_file *f)
+{
+ int e;
+
+ if (f->fp && (e = key_save(f)) != KWRITE_OK)
+ return (e);
+ key_discard(f);