Consistently use PR memory functions.

This commit is contained in:
wolfbeast 2018-05-15 21:20:45 +02:00 • committed by Roy Tam
commit f6fa2effca

View file

@ -5,6 +5,7 @@
#include "nsAuth.h" #include "nsAuth.h"
#include "nsAuthSambaNTLM.h" #include "nsAuthSambaNTLM.h"
#include "nspr.h"
#include "prenv.h" #include "prenv.h"
#include "plbase64.h" #include "plbase64.h"
#include "prerror.h" #include "prerror.h"
@ -23,7 +24,7 @@ nsAuthSambaNTLM::~nsAuthSambaNTLM()
// ntlm_auth reads from stdin regularly so closing our file handles // ntlm_auth reads from stdin regularly so closing our file handles
// should cause it to exit. // should cause it to exit.
Shutdown(); Shutdown();
free(mInitialMessage); PR_Free(mInitialMessage);
} }
void void
@ -248,7 +249,7 @@ nsAuthSambaNTLM::GetNextToken(const void *inToken,
nsCString request; nsCString request;
request.AssignLiteral("TT "); request.AssignLiteral("TT ");
request.Append(encoded); request.Append(encoded);
free(encoded); PR_Free(encoded);
request.Append('\n'); request.Append('\n');
if (!WriteString(mToChildFD, request)) if (!WriteString(mToChildFD, request))
@ -265,7 +266,7 @@ nsAuthSambaNTLM::GetNextToken(const void *inToken,
if (!buf) if (!buf)
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
*outToken = nsMemory::Clone(buf, *outTokenLen); *outToken = nsMemory::Clone(buf, *outTokenLen);
free(buf); PR_Free(buf);
if (!*outToken) { if (!*outToken) {
return NS_ERROR_OUT_OF_MEMORY; return NS_ERROR_OUT_OF_MEMORY;
} }