Skip to content
Snippets Groups Projects
Commit 453a1b23 authored by Marc-André Lureau's avatar Marc-André Lureau Committed by Greg Kurz
Browse files

9pfs: replace g_malloc()+memcpy() with g_memdup()


I found these pattern via grepping the source tree. I don't have a
coccinelle script for it!

Signed-off-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
parent b96feb2c
No related branches found
No related tags found
No related merge requests found
......@@ -494,8 +494,7 @@ static int synth_name_to_path(FsContext *ctx, V9fsPath *dir_path,
}
out:
/* Copy the node pointer to fid */
target->data = g_malloc(sizeof(void *));
memcpy(target->data, &node, sizeof(void *));
target->data = g_memdup(&node, sizeof(void *));
target->size = sizeof(void *);
return 0;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment