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;
|
return;
|
||||||
struct cwmp_mem *rm;
|
struct cwmp_mem *rm;
|
||||||
rm = container_of(m, struct cwmp_mem, mem);
|
rm = container_of(m, struct cwmp_mem, mem);
|
||||||
|
if (rm != NULL) {
|
||||||
list_del(&rm->list);
|
list_del(&rm->list);
|
||||||
free(rm);
|
free(rm);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void icwmp_cleanmem()
|
void icwmp_cleanmem()
|
||||||
|
|
@ -686,9 +688,11 @@ void icwmp_cleanmem()
|
||||||
struct cwmp_mem *mem;
|
struct cwmp_mem *mem;
|
||||||
while (cwmp_memory_list.next != &cwmp_memory_list) {
|
while (cwmp_memory_list.next != &cwmp_memory_list) {
|
||||||
mem = list_entry(cwmp_memory_list.next, struct cwmp_mem, list);
|
mem = list_entry(cwmp_memory_list.next, struct cwmp_mem, list);
|
||||||
|
if (mem != NULL) {
|
||||||
list_del(&mem->list);
|
list_del(&mem->list);
|
||||||
free(mem);
|
free(mem);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue