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

Unified Diff: runtime/bin/file_win.cc

Issue 172153007: Don't leak file names in Windows File::Stat(). (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 10 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: runtime/bin/file_win.cc
diff --git a/runtime/bin/file_win.cc b/runtime/bin/file_win.cc
index b43ae0c772334a51ae66b2a39123d0514644fcd9..f4be3498f6f281ca685d6cca6072b10f41658670 100644
--- a/runtime/bin/file_win.cc
+++ b/runtime/bin/file_win.cc
@@ -468,6 +468,7 @@ void File::Stat(const char* name, int64_t* data) {
struct _stat64 st;
const wchar_t* system_name = StringUtils::Utf8ToWide(name);
int stat_status = _wstat64(system_name, &st);
+ free(const_cast<wchar_t*>(system_name));
if (stat_status == 0) {
data[kCreatedTime] = st.st_ctime;
data[kModifiedTime] = st.st_mtime;
« 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