diff options
author | rodrigc <rodrigc@FreeBSD.org> | 2006-12-09 16:27:50 +0000 |
---|---|---|
committer | rodrigc <rodrigc@FreeBSD.org> | 2006-12-09 16:27:50 +0000 |
commit | e9a21b7fd84c778db132c4e05e9f424795c38106 (patch) | |
tree | 9cc023400d19bc8390378d51535de53422e922e3 /sys/fs | |
parent | e60a96b820b0972d01fe8f369a2fb92f26773014 (diff) | |
download | FreeBSD-src-e9a21b7fd84c778db132c4e05e9f424795c38106.zip FreeBSD-src-e9a21b7fd84c778db132c4e05e9f424795c38106.tar.gz |
In unionfs_hashrem(), use LIST_FOREACH_SAFE when iterating over
the list of nodes to free them.
CID: 1668
Found by: Coverity Prevent (tm)
Diffstat (limited to 'sys/fs')
-rw-r--r-- | sys/fs/unionfs/union_subr.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/fs/unionfs/union_subr.c b/sys/fs/unionfs/union_subr.c index 8d7e0a5..8968b6c 100644 --- a/sys/fs/unionfs/union_subr.c +++ b/sys/fs/unionfs/union_subr.c @@ -317,7 +317,7 @@ unionfs_hashrem(struct vnode *vp, struct thread *td) { int vfslocked; struct unionfs_node *unp; - struct unionfs_node_status *unsp; + struct unionfs_node_status *unsp, *unsp_tmp; struct vnode *lvp; struct vnode *uvp; @@ -367,7 +367,8 @@ unionfs_hashrem(struct vnode *vp, struct thread *td) free(unp->un_path, M_UNIONFSPATH); unp->un_path = NULL; } - while ((unsp = LIST_FIRST(&(unp->un_unshead))), NULL != unsp) { + + LIST_FOREACH_SAFE(unsp, &(unp->un_unshead), uns_list, unsp_tmp) { LIST_REMOVE(unsp, uns_list); free(unsp, M_TEMP); } |