This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Merge pull request #71 from richardleach/patch-1
[metaconfig.git] / U / threads / d_localtime_r.U
index de51966..53fa397 100644 (file)
@@ -132,6 +132,7 @@ REENTRANT_PROTO*)
 #endif
 int main()
 {
+    int result = 0;
     time_t t = time(0L);
     char w_tz[]="TZ" "=GMT+5",
         e_tz[]="TZ" "=GMT-5",
@@ -150,8 +151,10 @@ int main()
     localtime_r(&t, &tm_w);
 
     if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
-       return 1;
-    return 0;
+       result = 1;
+
+    free(tz_e);free(tz_w);
+    return result;
 }
 EOCP
        set try