Commit e71b83d76f7c2883f272f824505ec2e1fc66976a

Authored by Georg Hopp
1 parent 1084820a

initialize complete memory segment in calloc

Showing 1 changed file with 1 additions and 1 deletions
@@ -244,7 +244,7 @@ TR_calloc(size_t nmemb, size_t size) @@ -244,7 +244,7 @@ TR_calloc(size_t nmemb, size_t size)
244 size_t _size = nmemb * size; 244 size_t _size = nmemb * size;
245 void * mem = TR_malloc(_size); 245 void * mem = TR_malloc(_size);
246 246
247 - memset(mem, 0, _size); 247 + memset(mem, 0, TR_getUsableSize(mem));
248 248
249 return mem; 249 return mem;
250 } 250 }
Please register or login to post a comment