mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-05 15:45:04 -04:00
added a new method rs_malloc that checks its arguments and prints a stacktrace on error/weird call. Changed the code everywhere to use this instead of malloc. Removed some mallocs and replaced with RsTemporaryMemory
This commit is contained in:
parent
9c6e7dfc13
commit
d13526facd
39 changed files with 274 additions and 132 deletions
|
@ -273,7 +273,13 @@ bool RsLoginHandler::tryAutoLogin(const RsPeerId& ssl_id,std::string& ssl_passwd
|
|||
fseek(fp, 0, SEEK_END);
|
||||
datalen = ftell(fp);
|
||||
fseek(fp, 0, SEEK_SET);
|
||||
dataptr = (char *) malloc(datalen);
|
||||
dataptr = (char *) rs_safe_malloc(datalen);
|
||||
|
||||
if(data_ptr == NULL)
|
||||
{
|
||||
fclose(fp);
|
||||
return false;
|
||||
}
|
||||
fread(dataptr, 1, datalen, fp);
|
||||
fclose(fp);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue