mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-27 20:58:22 +00:00
tmpfs: fix use of nonzero'd memory
This commit is contained in:
@@ -509,6 +509,8 @@ static tmpfsnode_t *newnode(vfs_t *vfs, int type) {
|
||||
if (node == NULL)
|
||||
return NULL;
|
||||
|
||||
memset(node, 0, sizeof(tmpfsnode_t));
|
||||
|
||||
if (type == V_TYPE_DIR) {
|
||||
if (hashtable_init(&node->children, 32)) {
|
||||
slab_free(nodecache, node);
|
||||
@@ -522,7 +524,6 @@ static tmpfsnode_t *newnode(vfs_t *vfs, int type) {
|
||||
}
|
||||
}
|
||||
|
||||
memset(&node->attr, 0, sizeof(vattr_t));
|
||||
node->attr.type = type;
|
||||
node->attr.inode = ++((tmpfs_t *)vfs)->inodenumber;
|
||||
node->vnode.type = type;
|
||||
|
||||
Reference in New Issue
Block a user