mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-11-22 22:41:30 +03:00
Avoid potential memory leak
This commit is contained in:
parent
2dd97b0b8e
commit
f38b72a583
@ -119,18 +119,18 @@ void FreeObjList(struct MinList *objlist)
|
||||
struct nsObject *node;
|
||||
struct nsObject *nnode;
|
||||
|
||||
if(IsMinListEmpty((struct MinList *)objlist)) return;
|
||||
node = (struct nsObject *)GetHead((struct List *)objlist);
|
||||
|
||||
do {
|
||||
nnode=(struct nsObject *)GetSucc((struct Node *)node);
|
||||
if(node->Type == AMINS_RECT) {
|
||||
DelObjectNoFree(node);
|
||||
} else {
|
||||
DelObject(node);
|
||||
}
|
||||
} while((node=nnode));
|
||||
if(IsMinListEmpty((struct MinList *)objlist) == FALSE) {
|
||||
node = (struct nsObject *)GetHead((struct List *)objlist);
|
||||
|
||||
do {
|
||||
nnode = (struct nsObject *)GetSucc((struct Node *)node);
|
||||
if(node->Type == AMINS_RECT) {
|
||||
DelObjectNoFree(node);
|
||||
} else {
|
||||
DelObject(node);
|
||||
}
|
||||
} while((node = nnode));
|
||||
}
|
||||
free(objlist);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user