diff options
author | João Abecasis <joao@abecasis.name> | 2009-05-06 11:04:14 (GMT) |
---|---|---|
committer | João Abecasis <joao@abecasis.name> | 2009-05-08 11:43:41 (GMT) |
commit | 330bebda90472f12dcbfde5a04600f4f6e97326d (patch) | |
tree | 0ecb9fa2a27c5896b5ad2925b588b6139ece2169 /src/corelib | |
parent | 97d24ee90e59f7f33c28f6442e63d5f27fb7cca2 (diff) | |
download | Qt-330bebda90472f12dcbfde5a04600f4f6e97326d.zip Qt-330bebda90472f12dcbfde5a04600f4f6e97326d.tar.gz Qt-330bebda90472f12dcbfde5a04600f4f6e97326d.tar.bz2 |
Fix leak of global data
Static variable was dynamically allocated but never freed.
Task-number: 253013
Reviewed-by: Thiago
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/tools/qlocale.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp index 559ba81..a2154a9 100644 --- a/src/corelib/tools/qlocale.cpp +++ b/src/corelib/tools/qlocale.cpp @@ -5367,6 +5367,14 @@ static Bigint *mult(Bigint *a, Bigint *b) static Bigint *p5s; +struct p5s_deleter +{ + ~p5s_deleter() + { + Bfree(p5s); + } +}; + static Bigint *pow5mult(Bigint *b, int k) { Bigint *b1, *p5, *p51; @@ -5388,6 +5396,7 @@ static Bigint *pow5mult(Bigint *b, int k) return b; if (!(p5 = p5s)) { /* first time */ + static p5s_deleter deleter; p5 = p5s = i2b(625); p5->next = 0; } |