memory handling improvement

This commit is contained in:
suvendhu 2023-06-14 14:51:26 +05:30
parent 4775925cb4
commit ac7410a726

View file

@ -677,8 +677,10 @@ void icwmp_free(void *m)
return;
struct cwmp_mem *rm;
rm = container_of(m, struct cwmp_mem, mem);
if (rm != NULL) {
list_del(&rm->list);
free(rm);
}
}
void icwmp_cleanmem()
@ -686,9 +688,11 @@ void icwmp_cleanmem()
struct cwmp_mem *mem;
while (cwmp_memory_list.next != &cwmp_memory_list) {
mem = list_entry(cwmp_memory_list.next, struct cwmp_mem, list);
if (mem != NULL) {
list_del(&mem->list);
free(mem);
}
}
}
/*