Chromium Code Reviews| 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..64f5793497bca0100ddb8d1ebd6cd7af1c3535ae 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,8 @@ 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); |
|
binji
2014/08/06 17:17:59
could return error here?
Sam Clegg
2014/08/07 11:49:52
Done.
|
| int len; |
| error = manifest_node->Read(HandleAttr(), text, size, &len); |
| if (error) |