mirror of
https://github.com/Llewellynvdm/conky.git
synced 2025-02-12 00:48:49 +00:00
Fix a couple security nits from codeql
See: - https://github.com/brndnmtthws/conky/security/code-scanning/1 - https://github.com/brndnmtthws/conky/security/code-scanning/2 - https://github.com/brndnmtthws/conky/security/code-scanning/3
This commit is contained in:
parent
a3f31dd96d
commit
4807d3c68d
@ -49,7 +49,7 @@ void clear_diskio_stats() {
|
||||
cur = stats.next;
|
||||
stats.next = stats.next->next;
|
||||
free_and_zero(cur->dev);
|
||||
free(cur);
|
||||
delete cur;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -107,7 +107,7 @@ void cimlib_cleanup() {
|
||||
while (cur != nullptr) {
|
||||
last = cur;
|
||||
cur = last->next;
|
||||
free(last);
|
||||
delete last;
|
||||
}
|
||||
image_list_start = image_list_end = nullptr;
|
||||
}
|
||||
|
@ -249,8 +249,7 @@ static void update_mail_count(struct local_mail_s *mail) {
|
||||
/* . and .. are skipped */
|
||||
if (dirent->d_name[0] != '.') {
|
||||
mail->mail_count++;
|
||||
mailflags = static_cast<char *>(
|
||||
malloc(sizeof(char) * strlen(strrchr(dirent->d_name, ','))));
|
||||
mailflags = strdup(dirent->d_name);
|
||||
if (mailflags == nullptr) {
|
||||
NORM_ERR("malloc");
|
||||
return;
|
||||
|
Loading…
x
Reference in New Issue
Block a user