mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-02 14:16:16 -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
|
@ -114,13 +114,16 @@ void ops_finish(void)
|
|||
\note Should be freed after use with free().
|
||||
*/
|
||||
void *ops_mallocz(size_t n)
|
||||
{
|
||||
void *m=malloc(n);
|
||||
{
|
||||
void *m=malloc(n);
|
||||
|
||||
memset(m,'\0',n);
|
||||
if(m == NULL)
|
||||
fprintf(stderr,"(EE) Cannot allocate %d bytes of memory in %s\n",n,__PRETTY_FUNCTION__) ;
|
||||
else
|
||||
memset(m,'\0',n);
|
||||
|
||||
return m;
|
||||
}
|
||||
return m;
|
||||
}
|
||||
|
||||
typedef struct
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue