From 357633a4a3e40aa1f4ffacc0506da9b790b2bd76 Mon Sep 17 00:00:00 2001 From: Erik Verbruggen Date: Thu, 6 Dec 2012 13:52:16 +0100 Subject: [PATCH] Fixed memory leak. Change-Id: Id4ae9d9192e2f2bd97e4a789a1613b669feaccb0 Reviewed-by: Lars Knoll --- qv4ecmaobjects.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/qv4ecmaobjects.cpp b/qv4ecmaobjects.cpp index 6eca545..5a29c64 100644 --- a/qv4ecmaobjects.cpp +++ b/qv4ecmaobjects.cpp @@ -506,13 +506,13 @@ static inline QString ToLocaleTimeString(double t) static double getLocalTZA() { #ifndef Q_WS_WIN - struct tm* t; + struct tm t; time_t curr; time(&curr); - t = localtime(&curr); - time_t locl = mktime(t); - t = gmtime(&curr); - time_t globl = mktime(t); + localtime_r(&curr, &t); + time_t locl = mktime(&t); + gmtime_r(&curr, &t); + time_t globl = mktime(&t); return double(locl - globl) * 1000.0; #else TIME_ZONE_INFORMATION tzInfo; -- 2.7.4