clone_dentry(): Set name fields to NULL
authorEric Biggers <ebiggers3@gmail.com>
Sun, 19 Aug 2012 07:00:20 +0000 (02:00 -0500)
committerEric Biggers <ebiggers3@gmail.com>
Sun, 19 Aug 2012 07:00:20 +0000 (02:00 -0500)
src/dentry.c

index 2ab69484e8fbe2eadfbfc0fa28d2bb16f405a2d8..68f9c57afa9df926b1856ccb79b825b1ccd36f21 100644 (file)
@@ -537,7 +537,14 @@ struct dentry *clone_dentry(struct dentry *old)
        struct dentry *new = MALLOC(sizeof(struct dentry));
        if (!new)
                return NULL;
-       return memcpy(new, old, sizeof(struct dentry));
+       memcpy(new, old, sizeof(struct dentry));
+       new->file_name          = NULL;
+       new->file_name_len      = 0;
+       new->file_name_utf8     = NULL;
+       new->file_name_utf8_len = 0;
+       new->short_name         = NULL;
+       new->short_name_len     = 0;
+       return new;
 }
 
 /* Arguments for do_free_dentry(). */