diff options
author | robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-07-12 18:44:23 +0000 |
---|---|---|
committer | robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-07-12 18:44:23 +0000 |
commit | 4d3767373942c55be893d3bbbfe35e1975c2e1b4 (patch) | |
tree | 6730999af6144a1a5b25b0f70f38f5b7630bd6e2 /include | |
parent | f37f2ccd751615ca661e069b43e9c4e30ebaf007 (diff) |
Fix leak in SkAutoSTArray
https://codereview.chromium.org/18915010/
git-svn-id: http://skia.googlecode.com/svn/trunk@10053 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include')
-rw-r--r-- | include/core/SkTemplates.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/include/core/SkTemplates.h b/include/core/SkTemplates.h index bab1ceaa91..ac67f92c0c 100644 --- a/include/core/SkTemplates.h +++ b/include/core/SkTemplates.h @@ -250,7 +250,9 @@ public: } if (fCount != count) { - if (count > N) { + if (fCount > N) { + // 'fArray' was allocated last time so free it now + SkASSERT((T*) fStorage != fArray); sk_free(fArray); } @@ -260,7 +262,6 @@ public: fArray = (T*) fStorage; } else { fArray = NULL; - return; } fCount = count; |