mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-14 10:37:23 -07:00
chg: use calloc
This commit is contained in:
parent
99b6087b01
commit
ad72a424ef
15 changed files with 36 additions and 27 deletions
|
@ -811,7 +811,9 @@ int mbynam(model_t *dest, const char *key) {
|
|||
|
||||
if (!aliases->name)
|
||||
return(-1);
|
||||
if (!(ukey = malloc((size_t) 1 + strlen(key) + 1))) {
|
||||
|
||||
ukey = calloc((size_t) 1 + strlen(key) + 1, sizeof(char));
|
||||
if (!ukey) {
|
||||
uerror("[!] cannot allocate memory for comparison string");
|
||||
return(0);
|
||||
}
|
||||
|
@ -861,7 +863,9 @@ char * mnames(void) {
|
|||
++aptr;
|
||||
}
|
||||
if (!size) return(NULL);
|
||||
if ((string = malloc(size))) {
|
||||
|
||||
string = calloc(size, sizeof(char));
|
||||
if (string) {
|
||||
aptr = aliases;
|
||||
sptr = string;
|
||||
while (aptr->name) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue