cppcheck nullPointerOutOfMemory

This commit is contained in:
Philippe Teuwen committed 2025-03-24 23:46:43 +01:00
1 parent e42932738e
commit ad84875afd
44 files changed
+314 -5

No files matched your search

+4
View File
@@ -542,6 +542,10 @@ static void topaz_print_control_TLVs(uint8_t *memory) {
if (old == NULL) {
new = topaz_tag.dynamic_lock_areas = (dynamic_lock_area_t *) calloc(sizeof(dynamic_lock_area_t), sizeof(uint8_t));
if (new == NULL) {
PrintAndLogEx(ERR, "Memory allocation failed");
return;
}
} else {
while (old->next != NULL) {
old = old->next;