smbfs: plug smbfs_node_alloc() leak of name buffers when insmntque() fails

PR:	295577
MFC after:	2 weeks
This commit is contained in:
Haoxiang Li authored and Konstantin Belousov committed 2026-05-27 11:09:31 +03:00
1 parent f1de8e3511
commit f0e702a7a2
1 file changed
+4
+4
View File
@@ -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);
}