If you call get_fd_and_vnode() you need to free it with put_fd(), not
put_vnode() - thanks to Ingo for pointing this out. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7597 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
95a7b7a045
commit
70cdc7af60
@ -1143,6 +1143,9 @@ get_fd_and_vnode(int fd, struct vnode **_vnode, bool kernel)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// ToDo: when we can close a file descriptor at any point, investigate
|
||||
// if this is still valid to do (accessing the vnode without ref_count
|
||||
// or locking)
|
||||
*_vnode = descriptor->u.vnode;
|
||||
return descriptor;
|
||||
}
|
||||
@ -2886,7 +2889,7 @@ attr_remove(int fd, const char *name, bool kernel)
|
||||
else
|
||||
status = EROFS;
|
||||
|
||||
put_vnode(vnode);
|
||||
put_fd(fd);
|
||||
|
||||
return status;
|
||||
}
|
||||
@ -2926,9 +2929,9 @@ attr_rename(int fromfd, const char *fromName, int tofd, const char *toName, bool
|
||||
status = EROFS;
|
||||
|
||||
err1:
|
||||
put_vnode(toVnode);
|
||||
put_fd(tofd);
|
||||
err:
|
||||
put_vnode(fromVnode);
|
||||
put_fd(fromfd);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user