Zero memory used for encryuption keys.
am: e2e2d308df
Change-Id: I94d4cec05b76ade916cda42ae0b215f8272d7d51
diff --git a/CommandListener.cpp b/CommandListener.cpp
index 78973db..8da3f69 100644
--- a/CommandListener.cpp
+++ b/CommandListener.cpp
@@ -361,18 +361,8 @@
return;
}
- size_t dirent_len = offsetof(struct dirent, d_name) +
- fpathconf(dirfd(d), _PC_NAME_MAX) + 1;
-
- struct dirent *dent = (struct dirent *) malloc(dirent_len);
- if (dent == NULL) {
- cli->sendMsg(ResponseCode::OperationFailed, "Failed to allocate memory", true);
- return;
- }
-
- struct dirent *result;
-
- while (!readdir_r(d, dent, &result) && result != NULL) {
+ dirent* dent;
+ while ((dent = readdir(d)) != NULL) {
if (dent->d_name[0] == '.')
continue;
if (dent->d_type != DT_REG)
@@ -387,8 +377,6 @@
}
}
closedir(d);
-
- free(dent);
}
int CommandListener::AsecCmd::runCommand(SocketClient *cli,