mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-11-07 04:36:52 -10:00
smbfs: plug smbfs_node_alloc() leak of name buffers when insmntque() fails
PR: 295577 MFC after: 2 weeks
This commit is contained in:
1 parent
f1de8e3511
commit
f0e702a7a2
1 file changed
+4
@@ -212,6 +212,10 @@ smbfs_node_alloc(struct mount *mp, struct vnode *dvp, const char *dirnm,
|
||||
SMBERROR("new vnode '%s' born without parent ?\n", np->n_name);
|
||||
error = insmntque(vp, mp);
|
||||
if (error) {
|
||||
smbfs_name_free(np->n_name);
|
||||
free(np->n_rpath, M_SMBNODENAME);
|
||||
if (np->n_parent != NULL && (np->n_flag & NREFPARENT) != 0)
|
||||
vrele(np->n_parent);
|
||||
free(np, M_SMBNODE);
|
||||
return (error);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user