Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New version 1.3 of Argon2 #115

Merged
merged 20 commits into from
Mar 3, 2016
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use calloc() instead of malloc()+memset()
  • Loading branch information
jedisct1 committed Feb 19, 2016
commit 01b288aacdb7647c279b8f4726879de0d7269421
3 changes: 1 addition & 2 deletions src/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,11 @@ int allocate_memory(block **memory, uint32_t m_cost) {
return ARGON2_MEMORY_ALLOCATION_ERROR;
}

*memory = (block *)malloc(memory_size); /*2. Try to allocate*/
*memory = (block *)calloc(memory_size, 1); /*2. Try to allocate*/

if (!*memory) {
return ARGON2_MEMORY_ALLOCATION_ERROR;
}
memset(*memory,0, memory_size);
return ARGON2_OK;
} else {
return ARGON2_MEMORY_ALLOCATION_ERROR;
Expand Down