mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2026-10-28 16:33:05 +00:00
Fix some missing frees, null dereferences and missing initialisation picked up by clang-analyzer
This commit is contained in:
1 parent
5db2276602
commit
d2d6f80d11
11 files changed
+24
-15
No files matched your search
@@ -1333,11 +1333,12 @@ static int l_cwd(lua_State *L) {
|
||||
while (GetCurrentDir(cwd, path_len) == NULL) {
|
||||
if (errno == ERANGE) { // Need bigger buffer
|
||||
path_len += 10; // if buffer was too small add 10 characters and try again
|
||||
cwd = realloc(cwd, path_len);
|
||||
if (cwd == NULL) {
|
||||
char* cwdNew = realloc(cwd, path_len);
|
||||
if (cwdNew == NULL) {
|
||||
free(cwd);
|
||||
return returnToLuaWithError(L, "Failed to allocate memory");
|
||||
}
|
||||
cwd = cwdNew;
|
||||
} else {
|
||||
free(cwd);
|
||||
return returnToLuaWithError(L, "Failed to get current working directory");
|
||||
|
||||
Reference in new issue
Block a user