mirror of
https://dev.iopsys.eu/bbf/icwmp.git
synced 2025-12-10 07:44:41 +01:00
memory handling improvement
This commit is contained in:
parent
4775925cb4
commit
ac7410a726
1 changed files with 8 additions and 4 deletions
4
common.c
4
common.c
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue