diff options
author | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2009-11-15 23:11:41 +0000 |
---|---|---|
committer | Chris Young <chris@unsatisfactorysoftware.co.uk> | 2009-11-15 23:11:41 +0000 |
commit | bc4abe90878b5550d1461287d5a9f060565c30b9 (patch) | |
tree | 9e99ab54797c6da043b1dccd6be7fa7d4bc88780 /amiga/download.c | |
parent | 9e86512c4fa7851571571b9a2835c2f019ca2b6a (diff) | |
download | netsurf-bc4abe90878b5550d1461287d5a9f060565c30b9.tar.gz netsurf-bc4abe90878b5550d1461287d5a9f060565c30b9.tar.bz2 |
Fix some potential issues with lists not being freed properly
svn path=/trunk/netsurf/; revision=9677
Diffstat (limited to 'amiga/download.c')
-rw-r--r-- | amiga/download.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/amiga/download.c b/amiga/download.c index 8837e983e..48f719a60 100644 --- a/amiga/download.c +++ b/amiga/download.c @@ -224,17 +224,19 @@ void ami_free_download_list(struct List *dllist) struct dlnode *node; struct dlnode *nnode; + if(!dllist) return; + if(IsListEmpty(dllist)) return; + node = (struct dlnode *)GetHead((struct List *)dllist); - while(nnode=(struct dlnode *)GetSucc((struct Node *)node)) + do { + nnode=(struct dlnode *)GetSucc((struct Node *)node); free(node->node.ln_Name); free(node->filename); Remove((struct Node *)node); FreeVec((struct Node *)node); - - node=nnode; - } + }while(node=nnode); } void gui_window_save_as_link(struct gui_window *g, struct content *c) |