1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2024-12-23 21:34:54 +03:00

src: libvirt-stream: use g_new0 instead of VIR_ALLOC*

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
Ján Tomko 2020-09-23 20:43:49 +02:00
parent 98906dbcee
commit 6e9a2351d4

View File

@ -588,8 +588,7 @@ virStreamSendAll(virStreamPtr stream,
goto cleanup;
}
if (VIR_ALLOC_N(bytes, want) < 0)
goto cleanup;
bytes = g_new0(char, want);
errno = 0;
for (;;) {
@ -724,8 +723,7 @@ int virStreamSparseSendAll(virStreamPtr stream,
goto cleanup;
}
if (VIR_ALLOC_N(bytes, bufLen) < 0)
goto cleanup;
bytes = g_new0(char, bufLen);
errno = 0;
for (;;) {
@ -859,8 +857,7 @@ virStreamRecvAll(virStreamPtr stream,
}
if (VIR_ALLOC_N(bytes, want) < 0)
goto cleanup;
bytes = g_new0(char, want);
errno = 0;
for (;;) {
@ -977,8 +974,7 @@ virStreamSparseRecvAll(virStreamPtr stream,
goto cleanup;
}
if (VIR_ALLOC_N(bytes, want) < 0)
goto cleanup;
bytes = g_new0(char, want);
errno = 0;
for (;;) {