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

Unified Diff: ppapi/cpp/websocket.cc

Issue 23441026: Don't check the result of new for NULL. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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: ppapi/cpp/websocket.cc
diff --git a/ppapi/cpp/websocket.cc b/ppapi/cpp/websocket.cc
index f0ae5fa0c30075ddef20cfc14a2f0b65983b0833..afd1310f072c58324dbba1d3a944d33ac35d2ba4 100644
--- a/ppapi/cpp/websocket.cc
+++ b/ppapi/cpp/websocket.cc
@@ -39,11 +39,8 @@ int32_t WebSocket::Connect(const Var& url, const Var protocols[],
// Convert protocols to C interface.
PP_Var *c_protocols = NULL;
- if (protocol_count) {
+ if (protocol_count)
c_protocols = new PP_Var[protocol_count];
- if (!c_protocols)
- return PP_ERROR_NOMEMORY;
- }
for (uint32_t i = 0; i < protocol_count; ++i)
c_protocols[i] = protocols[i].pp_var();
« net/tools/crash_cache/crash_cache.cc ('K') | « net/tools/crash_cache/crash_cache.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698