Fix leak in SkFontHost_fontconfig temporary code.
https://codereview.chromium.org/16525003 git-svn-id: http://skia.googlecode.com/svn/trunk@9460 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
parent
19e80c16a5
commit
88605bb51d
@ -154,7 +154,9 @@ SkStream* FontConfigTypeface::onOpenStream(int* ttcIndex) const {
|
||||
SkAutoTMalloc<uint8_t> allocMemory(length);
|
||||
stream->rewind();
|
||||
if (length == stream->read(allocMemory.get(), length)) {
|
||||
return new SkMemoryStream(allocMemory.detach(), length);
|
||||
SkAutoTUnref<SkMemoryStream> copyStream(new SkMemoryStream());
|
||||
copyStream->setMemoryOwned(allocMemory.detach(), length);
|
||||
return copyStream.detach();
|
||||
}
|
||||
|
||||
stream->rewind();
|
||||
|
Loading…
Reference in New Issue
Block a user