]> diplodocus.org Git - nmh/commitdiff
Added free_fs(), corresponding to new_fs().
authorDavid Levine <levinedl@acm.org>
Sun, 26 Oct 2014 01:38:20 +0000 (20:38 -0500)
committerDavid Levine <levinedl@acm.org>
Sun, 26 Oct 2014 01:38:20 +0000 (20:38 -0500)
h/fmt_scan.h
sbr/fmt_new.c

index 2bcc265..5f659d4 100644 (file)
@@ -114,6 +114,12 @@ struct fmt_callbacks {
 
 char *new_fs (char *form, char *format, char *default_fs);
 
+/*
+ * Free memory allocated by new_fs().  It allocates to a static so
+ * no argument is necessary.
+ */
+void free_fs ();
+
 /*
  * Compile a format string into a set of format instructions.  Arguments are:
  *
index 44a18b3..9ee8956 100644 (file)
@@ -58,6 +58,13 @@ new_fs (char *form, char *format, char *default_fs)
 }
 
 
+void
+free_fs (){
+    free (formats);
+    formats = 0;
+}
+
+
 /*
  * Expand escapes in format strings
  */