mirror of
https://github.com/hashcat/hashcat
synced 2025-03-26 12:12:43 +01:00
Merge pull request #1379 from neheb/patch-1
Adjust hcmalloc to be the same as calloc
This commit is contained in:
commit
a445f48a39
12
src/memory.c
12
src/memory.c
@ -23,16 +23,8 @@ void *hccalloc (const size_t nmemb, const size_t sz)
|
|||||||
|
|
||||||
void *hcmalloc (const size_t sz)
|
void *hcmalloc (const size_t sz)
|
||||||
{
|
{
|
||||||
void *p = malloc (sz);
|
//calloc is faster than malloc with big allocations, so just use that.
|
||||||
|
void *p = hccalloc (sz, 1);
|
||||||
if (p == NULL)
|
|
||||||
{
|
|
||||||
fprintf (stderr, "%s\n", MSG_ENOMEM);
|
|
||||||
|
|
||||||
return (NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
memset (p, 0, sz);
|
|
||||||
|
|
||||||
return (p);
|
return (p);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user