aboutsummaryrefslogtreecommitdiff
path: root/hw/9pfs/codir.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/9pfs/codir.c')
-rw-r--r--hw/9pfs/codir.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/hw/9pfs/codir.c b/hw/9pfs/codir.c
index 032cce0..c0873bd 100644
--- a/hw/9pfs/codir.c
+++ b/hw/9pfs/codir.c
@@ -143,8 +143,7 @@ static int do_readdir_many(V9fsPDU *pdu, V9fsFidState *fidp,
} else {
e = e->next = g_malloc0(sizeof(V9fsDirEnt));
}
- e->dent = g_malloc0(sizeof(struct dirent));
- memcpy(e->dent, dent, sizeof(struct dirent));
+ e->dent = qemu_dirent_dup(dent);
/* perform a full stat() for directory entry if requested by caller */
if (dostat) {