From: David Levine Date: Sun, 26 Oct 2014 01:38:20 +0000 (-0500) Subject: Added free_fs(), corresponding to new_fs(). X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/c6a1c64318fe98826be1e98ed8a237469468df5d?ds=sidebyside Added free_fs(), corresponding to new_fs(). --- diff --git a/h/fmt_scan.h b/h/fmt_scan.h index 2bcc265f..5f659d4c 100644 --- a/h/fmt_scan.h +++ b/h/fmt_scan.h @@ -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: * diff --git a/sbr/fmt_new.c b/sbr/fmt_new.c index 44a18b37..9ee89561 100644 --- a/sbr/fmt_new.c +++ b/sbr/fmt_new.c @@ -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 */