Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F177433621
D61366.1794377116.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
D61366.1794377116.diff
View Options
diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c
--- a/sys/kern/vfs_lookup.c
+++ b/sys/kern/vfs_lookup.c
@@ -689,11 +689,14 @@
*/
MPASS(cnp->cn_pnbuf != NULL);
error = 0;
- } else
+ } else {
error = namei_getpath(ndp);
+ }
if (__predict_false(error != 0)) {
namei_cleanup_cnp(cnp);
nameicap_cleanup(ndp, error);
+ if (ndp->ni_startdir != NULL)
+ vrele(ndp->ni_startdir);
SDT_PROBE4(vfs, namei, lookup, return, error, NULL,
false, ndp);
return (error);
@@ -754,6 +757,8 @@
}
namei_cleanup_cnp(cnp);
nameicap_cleanup(ndp, ENOENT);
+ if (ndp->ni_startdir != NULL)
+ vrele(ndp->ni_startdir);
SDT_PROBE4(vfs, namei, lookup, return, ENOENT, NULL,
false, ndp);
return (ENOENT);
diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c
--- a/sys/kern/vfs_vnops.c
+++ b/sys/kern/vfs_vnops.c
@@ -301,8 +301,11 @@
fmode = *flagp;
if ((fmode & (O_CREAT | O_EXCL | O_DIRECTORY)) == (O_CREAT |
O_EXCL | O_DIRECTORY) ||
- (fmode & (O_CREAT | O_EMPTY_PATH)) == (O_CREAT | O_EMPTY_PATH))
+ (fmode & (O_CREAT | O_EMPTY_PATH)) == (O_CREAT | O_EMPTY_PATH)) {
+ if (ndp->ni_startdir != NULL)
+ vrele(ndp->ni_startdir);
return (EINVAL);
+ }
else if ((fmode & (O_CREAT | O_DIRECTORY)) == O_CREAT) {
ndp->ni_cnd.cn_nameiop = CREATE;
ndp->ni_cnd.cn_flags = open2nameif(fmode, vn_open_flags,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Nov 11, 6:05 AM (14 h, 23 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41653872
Default Alt Text
D61366.1794377116.diff (1 KB)
Attached To
Mode
D61366: Fix several ni_startdir leaks
Attached
Detach File
Event Timeline