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

Unified Diff: sandbox/win/src/filesystem_interception.cc

Issue 849553002: Fix some sandbox memory leaks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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: sandbox/win/src/filesystem_interception.cc
diff --git a/sandbox/win/src/filesystem_interception.cc b/sandbox/win/src/filesystem_interception.cc
index 179cad5e62f2e676322751ef7513148fd86045c2..043e1fa4012cdc2513121d7f95b86fb27bb4c203 100644
--- a/sandbox/win/src/filesystem_interception.cc
+++ b/sandbox/win/src/filesystem_interception.cc
@@ -74,14 +74,15 @@ NTSTATUS WINAPI TargetNtCreateFile(NtCreateFileFunction orig_CreateFile,
if (SBOX_ALL_OK != code)
break;
+ status = answer.nt_status;
+
if (!NT_SUCCESS(answer.nt_status))
- return answer.nt_status;
+ break;
__try {
*file = answer.handle;
io_status->Status = answer.nt_status;
io_status->Information = answer.extended[0].ulong_ptr;
- status = io_status->Status;
} __except(EXCEPTION_EXECUTE_HANDLER) {
break;
}
@@ -145,14 +146,15 @@ NTSTATUS WINAPI TargetNtOpenFile(NtOpenFileFunction orig_OpenFile, PHANDLE file,
if (SBOX_ALL_OK != code)
break;
+ status = answer.nt_status;
+
if (!NT_SUCCESS(answer.nt_status))
- return answer.nt_status;
+ break;
__try {
*file = answer.handle;
io_status->Status = answer.nt_status;
io_status->Information = answer.extended[0].ulong_ptr;
- status = io_status->Status;
} __except(EXCEPTION_EXECUTE_HANDLER) {
break;
}
@@ -208,12 +210,10 @@ NTSTATUS WINAPI TargetNtQueryAttributesFile(
ResultCode code = CrossCall(ipc, IPC_NTQUERYATTRIBUTESFILE_TAG, name,
attributes, file_info, &answer);
- operator delete(name, NT_ALLOC);
-
if (SBOX_ALL_OK != code)
break;
- return answer.nt_status;
+ status = answer.nt_status;
} while (false);
@@ -269,12 +269,10 @@ NTSTATUS WINAPI TargetNtQueryFullAttributesFile(
ResultCode code = CrossCall(ipc, IPC_NTQUERYFULLATTRIBUTESFILE_TAG, name,
attributes, file_info, &answer);
- operator delete(name, NT_ALLOC);
-
if (SBOX_ALL_OK != code)
break;
- return answer.nt_status;
+ status = answer.nt_status;
} while (false);
if (name)
« 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