1
0

fix(lab02): avoid to free a null pointer

This commit is contained in:
2026-03-31 21:06:05 +02:00
parent a6ef142912
commit e4089d2e05

View File

@@ -49,8 +49,10 @@ void dynAlloc_exit(void) {
e = list_entry(list_unique_elements.next, struct element, node);
pr_info ("delete element %d: %s\n", e->unique_number, e->text);
list_del(&e->node);
if (e != 0) {
kfree(e);
}
}
pr_info("Memory allocated for dynamic allocation and linked list freed\n");
}