]> Savannah Git Hosting - gnulib.git/commitdiff
parse-datetime: Fix memleak
authorTim Rühsen <tim.ruehsen@gmx.de>
Wed, 17 May 2017 08:02:39 +0000 (10:02 +0200)
committerBruno Haible <bruno@clisp.org>
Wed, 17 May 2017 08:02:39 +0000 (10:02 +0200)
* lib/parse-datetime.y (parse_datetime2): Cleanup on
localtime_rz() failure.

ChangeLog
lib/parse-datetime.y

index 932383e064b11ab8c631a6ef5ef4975a85737847..cb9ffbc0f5ffc0a1b34524121dc038b700dea112 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2017-05-16  Tim Rühsen  <tim.ruehsen@gmx.de>
+
+       parse-datetime: Fix memleak
+       * lib/parse-datetime.y (parse_datetime2): Cleanup on
+       localtime_rz() failure.
+
 2017-05-16  Bruno Haible  <bruno@clisp.org>
 
        javacomp: Fix handle leak.
index 598e385cb07ca6b9f7e3275870fb0145000d778a..60c64934c93749f7507889223162ee404a9b04d2 100644 (file)
@@ -1811,7 +1811,7 @@ parse_datetime2 (struct timespec *result, char const *p,
 
   struct tm tmp;
   if (! localtime_rz (tz, &now->tv_sec, &tmp))
-    return false;
+    goto fail;
 
   /* As documented, be careful to treat the empty string just like
      a date string of "0".  Without this, an empty string would be