mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-11-01 06: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)
|
if (node == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
memset(node, 0, sizeof(tmpfsnode_t));
|
||||||
|
|
||||||
if (type == V_TYPE_DIR) {
|
if (type == V_TYPE_DIR) {
|
||||||
if (hashtable_init(&node->children, 32)) {
|
if (hashtable_init(&node->children, 32)) {
|
||||||
slab_free(nodecache, node);
|
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.type = type;
|
||||||
node->attr.inode = ++((tmpfs_t *)vfs)->inodenumber;
|
node->attr.inode = ++((tmpfs_t *)vfs)->inodenumber;
|
||||||
node->vnode.type = type;
|
node->vnode.type = type;
|
||||||
|
|||||||
Reference in New Issue
Block a user