mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-28 08:07:31 -04:00
added checks after mallocs in several files
This commit is contained in:
parent
46520b0e22
commit
9c6e7dfc13
15 changed files with 157 additions and 12 deletions
|
@ -40,6 +40,12 @@ PassphraseCallback PGPHandler::_passphrase_callback = NULL ;
|
|||
ops_keyring_t *PGPHandler::allocateOPSKeyring()
|
||||
{
|
||||
ops_keyring_t *kr = (ops_keyring_t*)malloc(sizeof(ops_keyring_t)) ;
|
||||
|
||||
if(kr == NULL)
|
||||
{
|
||||
std::cerr << "(EE) Cannot allocate memory for " << sizeof(ops_keyring_t) << " bytes in " << __PRETTY_FUNCTION__ << std::endl;
|
||||
return NULL ;
|
||||
}
|
||||
kr->nkeys = 0 ;
|
||||
kr->nkeys_allocated = 0 ;
|
||||
kr->keys = 0 ;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue