test-iov: 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: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Richard Henderson <rth@twiddle.net>
This commit is contained in:
parent
ad2c19937e
commit
38cc1dba1f
@ -167,8 +167,7 @@ static void test_io(void)
|
||||
}
|
||||
iov_from_buf(iov, niov, 0, buf, sz);
|
||||
|
||||
siov = g_malloc(sizeof(*iov) * niov);
|
||||
memcpy(siov, iov, sizeof(*iov) * niov);
|
||||
siov = g_memdup(iov, sizeof(*iov) * niov);
|
||||
|
||||
if (socketpair(PF_UNIX, SOCK_STREAM, 0, sv) < 0) {
|
||||
perror("socketpair");
|
||||
|
Loading…
Reference in New Issue
Block a user