Bug 1020432 - Leak of |buf| in nsAuthSambaNTLM::GetNextToken, r=honzab

This commit is contained in:
Nochum Sossonko 2014-06-22 11:10:08 -07:00
parent bee6f49645
commit 8b7c4455bd

View File

@ -265,8 +265,8 @@ nsAuthSambaNTLM::GetNextToken(const void *inToken,
return NS_ERROR_FAILURE;
// *outToken has to be freed by nsMemory::Free, which may not be free()
*outToken = nsMemory::Clone(buf, *outTokenLen);
free(buf);
if (!*outToken) {
free(buf);
return NS_ERROR_OUT_OF_MEMORY;
}