Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(683)

Unified Diff: src/views/win/skia_win.cpp

Issue 548343002: When parsing arguments on Windows, check malloc() for failure. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Use sk_malloc_throw in place of malloc() Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/views/win/skia_win.cpp
diff --git a/src/views/win/skia_win.cpp b/src/views/win/skia_win.cpp
index 72ff54fedd26f139421b59ced015d2d10d05d9d9..e2f0fdaf9419ed2823d4d60668fbef909f85f9b9 100644
--- a/src/views/win/skia_win.cpp
+++ b/src/views/win/skia_win.cpp
@@ -100,7 +100,7 @@ static SkOSWindow* gSkWind;
char* tchar_to_utf8(const TCHAR* str) {
#ifdef _UNICODE
int size = WideCharToMultiByte(CP_UTF8, 0, str, wcslen(str), NULL, 0, NULL, NULL);
- char* str8 = (char*) malloc(size+1);
+ char* str8 = (char*) sk_malloc_throw(size+1);
WideCharToMultiByte(CP_UTF8, 0, str, wcslen(str), str8, size, NULL, NULL);
str8[size] = '\0';
return str8;
@@ -150,7 +150,7 @@ BOOL InitInstance(HINSTANCE hInstance, int nCmdShow, LPTSTR lpCmdLine)
gSkWind = create_sk_window(hWnd, argc, argv);
for (int i = 0; i < argc; ++i) {
- free(argv[i]);
+ sk_free(argv[i]);
}
ShowWindow(hWnd, nCmdShow);
UpdateWindow(hWnd);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698