Fix memory leak in SkTypeface.cpp
https://codereview.chromium.org/14617019/ git-svn-id: http://skia.googlecode.com/svn/trunk@9099 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
parent
94b284d719
commit
9e9dfa3a67
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user