aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-07-12 18:44:23 +0000
committerGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-07-12 18:44:23 +0000
commit4d3767373942c55be893d3bbbfe35e1975c2e1b4 (patch)
tree6730999af6144a1a5b25b0f70f38f5b7630bd6e2 /include
parentf37f2ccd751615ca661e069b43e9c4e30ebaf007 (diff)
Fix leak in SkAutoSTArray
Diffstat (limited to 'include')
-rw-r--r--include/core/SkTemplates.h5
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;