OSDN Git Service
(root)
/
qmiga
/
qemu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b96feb2
)
9pfs: replace g_malloc()+memcpy() with g_memdup()
author
Marc-André Lureau
<marcandre.lureau@redhat.com>
Thu, 29 Jun 2017 13:11:50 +0000
(15:11 +0200)
committer
Greg Kurz
<groug@kaod.org>
Thu, 29 Jun 2017 13:11:50 +0000
(15:11 +0200)
I found these pattern via grepping the source tree. I don't have a
coccinelle script for it!
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
hw/9pfs/9p-synth.c
patch
|
blob
|
history
diff --git
a/hw/9pfs/9p-synth.c
b/hw/9pfs/9p-synth.c
index
4b6d4e6
..
df0a8de
100644
(file)
--- a/
hw/9pfs/9p-synth.c
+++ b/
hw/9pfs/9p-synth.c
@@
-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;
}