Null a pointer after it is freed so that when it is returned
the return value is NULL. Based on the returned flags, the return value should never be inspected in the case where NULL is returned, but it is good coding practice not to return a pointer to freed memory. Found by: Coverity Scan, CID 1006096 Reviewed by: kib MFC after: 2 weeks
This commit is contained in:
parent
ef9c2a5744
commit
bcfba66af4
@ -8150,6 +8150,7 @@ setup_newdir(dap, newinum, dinum, newdirbp, mkdirp)
|
|||||||
(inodedep->id_state & ALLCOMPLETE) == ALLCOMPLETE) {
|
(inodedep->id_state & ALLCOMPLETE) == ALLCOMPLETE) {
|
||||||
dap->da_state &= ~MKDIR_PARENT;
|
dap->da_state &= ~MKDIR_PARENT;
|
||||||
WORKITEM_FREE(mkdir2, D_MKDIR);
|
WORKITEM_FREE(mkdir2, D_MKDIR);
|
||||||
|
mkdir2 = NULL;
|
||||||
} else {
|
} else {
|
||||||
LIST_INSERT_HEAD(&mkdirlisthd, mkdir2, md_mkdirs);
|
LIST_INSERT_HEAD(&mkdirlisthd, mkdir2, md_mkdirs);
|
||||||
WORKLIST_INSERT(&inodedep->id_bufwait, &mkdir2->md_list);
|
WORKLIST_INSERT(&inodedep->id_bufwait, &mkdir2->md_list);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user