aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/test-iov.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/tests/test-iov.c b/tests/test-iov.c
index a22d71f..fa3d75a 100644
--- a/tests/test-iov.c
+++ b/tests/test-iov.c
@@ -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");