striconveh: Simplify last commit.
[gnulib.git] / lib / getdate.y
index e61ffdf..445865b 100644 (file)
@@ -1,8 +1,8 @@
 %{
 /* Parse a string into an internal time stamp.
 
-   Copyright (C) 1999, 2000, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
-   Free Software Foundation, Inc.
+   Copyright (C) 1999, 2000, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
+   2010 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -1145,8 +1145,8 @@ yylex (YYSTYPE *lvalp, parser_control *pc)
 
 /* Do nothing if the parser reports an error.  */
 static int
-yyerror (parser_control const *pc _UNUSED_PARAMETER_,
-         char const *s _UNUSED_PARAMETER_)
+yyerror (parser_control const *pc _GL_UNUSED,
+         char const *s _GL_UNUSED)
 {
   return 0;
 }
@@ -1252,6 +1252,8 @@ get_date (struct timespec *result, char const *p, struct timespec const *now)
             char tz1buf[TZBUFSIZE];
             bool large_tz = TZBUFSIZE < tzsize;
             bool setenv_ok;
+            /* Free tz0, in case this is the 2nd or subsequent time through. */
+            free (tz0);
             tz0 = get_tz (tz0buf);
             z = tz1 = large_tz ? xmalloc (tzsize) : tz1buf;
             for (s = tzbase; *s != '"'; s++)