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

Unified Diff: runtime/bin/dartutils.cc

Issue 1781883002: Fixes some memory leaks in //runtime/bin (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Fix tests on Windows Created 4 years, 9 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 | « runtime/bin/dartutils.h ('k') | runtime/bin/directory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/dartutils.cc
diff --git a/runtime/bin/dartutils.cc b/runtime/bin/dartutils.cc
index f592f2c142d17ec13d46addfe73ae34f4db0e328..09258f7004af68cf110f750f37f5026199203621 100644
--- a/runtime/bin/dartutils.cc
+++ b/runtime/bin/dartutils.cc
@@ -630,10 +630,9 @@ void FUNCTION_NAME(Builtin_NativeLibraryExtension)(Dart_NativeArguments args) {
void FUNCTION_NAME(Builtin_GetCurrentDirectory)(Dart_NativeArguments args) {
- char* current = Directory::Current();
+ const char* current = Directory::Current();
if (current != NULL) {
Dart_SetReturnValue(args, DartUtils::NewString(current));
- free(current);
} else {
Dart_Handle err = DartUtils::NewError("Failed to get current directory.");
Dart_PropagateError(err);
@@ -952,7 +951,7 @@ Dart_Handle DartUtils::NewInternalError(const char* message) {
bool DartUtils::SetOriginalWorkingDirectory() {
- original_working_directory = Directory::Current();
+ original_working_directory = Directory::CurrentNoScope();
return original_working_directory != NULL;
}
« no previous file with comments | « runtime/bin/dartutils.h ('k') | runtime/bin/directory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698