Bug 1376638 - Minimize uses of prmem.h. r=glandium.

It's silly to use prmem.h within Firefox code given that in our configuration
its functions are just wrappers for malloc() et al. (Indeed, in some places we
mix PR_Malloc() with free(), or malloc() with PR_Free().)

This patch removes all uses, except for the places where we need to use
PR_Free() to free something allocated by another NSPR function; in those cases
I've added a comment explaining which function did the allocation.
This commit is contained in:
Nicholas Nethercote
2017-06-30 19:05:41 -07:00
parent a8cada8c08
commit fcd4f4fa21
69 changed files with 158 additions and 198 deletions

View File

@@ -2869,7 +2869,7 @@ WebSocketChannel::SetupRequest()
if (!b64)
return NS_ERROR_OUT_OF_MEMORY;
secKeyString.Assign(b64);
PR_Free(b64);
PR_Free(b64); // PL_Base64Encode() uses PR_Malloc.
rv = mHttpChannel->SetRequestHeader(NS_LITERAL_CSTRING("Sec-WebSocket-Key"),
secKeyString, false);
MOZ_ASSERT(NS_SUCCEEDED(rv));