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

Unified Diff: native_client_sdk/src/libraries/nacl_io/httpfs/http_fs.cc

Issue 443693002: [NaCl SDK] nacl_io: Remove use of new/delete for data buffers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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
Index: native_client_sdk/src/libraries/nacl_io/httpfs/http_fs.cc
diff --git a/native_client_sdk/src/libraries/nacl_io/httpfs/http_fs.cc b/native_client_sdk/src/libraries/nacl_io/httpfs/http_fs.cc
index 95809996b8bf6c01800b3a03f8dc59e130bf9d6a..cc44cfa0ba20959a22108b812f4e42867127bb2e 100644
--- a/native_client_sdk/src/libraries/nacl_io/httpfs/http_fs.cc
+++ b/native_client_sdk/src/libraries/nacl_io/httpfs/http_fs.cc
@@ -226,11 +226,11 @@ Error HttpFs::Init(const FsInitArgs& args) {
error = ParseManifest(text);
if (error) {
- delete[] text;
+ free(text);
return error;
}
- delete[] text;
+ free(text);
} else if (iter->first == "allow_cross_origin_requests") {
allow_cors_ = iter->second == "true";
} else if (iter->first == "allow_credentials") {
@@ -396,7 +396,10 @@ Error HttpFs::LoadManifest(const std::string& manifest_name,
if (error)
return error;
- char* text = new char[size + 1];
+ char* text = (char*)malloc(size + 1);
+ assert(text != NULL);
+ if (text == NULL)
+ return ENOMEM;
int len;
error = manifest_node->Read(HandleAttr(), text, size, &len);
if (error)
« no previous file with comments | « native_client_sdk/src/libraries/nacl_io/fifo_char.cc ('k') | native_client_sdk/src/libraries/nacl_io/httpfs/http_fs_node.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698