aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-05-10 17:22:48 +0000
committerGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-05-10 17:22:48 +0000
commit9e9dfa3a677d8f5042bb87a1201434421e7de002 (patch)
tree8e81843bffcfe99ad8b4f857b9dd424d0ea8a915 /src
parent94b284d719ee5ccd3e2efbd1d7084ec554583bac (diff)
Fix memory leak in SkTypeface.cpp
Diffstat (limited to 'src')
-rw-r--r--src/core/SkTypeface.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/core/SkTypeface.cpp b/src/core/SkTypeface.cpp
index 5bd9d165bb..cc60ca1809 100644
--- a/src/core/SkTypeface.cpp
+++ b/src/core/SkTypeface.cpp
@@ -116,8 +116,9 @@ SkTypeface* SkTypeface::Deserialize(SkStream* stream) {
if (length > 0) {
void* addr = sk_malloc_flags(length, 0);
if (addr) {
- SkAutoTUnref<SkStream> localStream(SkNEW_ARGS(SkMemoryStream,
- (addr, length, false)));
+ SkAutoTUnref<SkMemoryStream> localStream(SkNEW(SkMemoryStream));
+ localStream->setMemoryOwned(addr, length);
+
if (stream->read(addr, length) == length) {
return SkTypeface::CreateFromStream(localStream.get());
} else {