mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 22:03:42 -07:00
fix memleak on realloc
This commit is contained in:
parent
49687f4749
commit
72170720fb
1 changed files with 3 additions and 2 deletions
|
@ -100,8 +100,10 @@ int searchHomeFilePath(char **foundpath, const char *subdir, const char *filenam
|
||||||
if (subdir != NULL) {
|
if (subdir != NULL) {
|
||||||
pathlen += strlen(subdir);
|
pathlen += strlen(subdir);
|
||||||
path = realloc(path, pathlen * sizeof(char));
|
path = realloc(path, pathlen * sizeof(char));
|
||||||
if (path == NULL)
|
if (path == NULL) {
|
||||||
|
free(path);
|
||||||
return PM3_EMALLOC;
|
return PM3_EMALLOC;
|
||||||
|
}
|
||||||
strcat(path, subdir);
|
strcat(path, subdir);
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
@ -536,7 +538,6 @@ void memcpy_filter_emoji(void *dest, const void *src, size_t n, emojiMode_t mode
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
memcpy(rdest + si, current_token, current_token_length);
|
memcpy(rdest + si, current_token, current_token_length);
|
||||||
si += current_token_length;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue