]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
src: libvirt-stream: use g_new0 instead of VIR_ALLOC*
authorJán Tomko <jtomko@redhat.com>
Wed, 23 Sep 2020 18:43:49 +0000 (20:43 +0200)
committerJán Tomko <jtomko@redhat.com>
Thu, 1 Oct 2020 10:34:13 +0000 (12:34 +0200)
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
src/libvirt-stream.c

index aeb7562018711f5afb87dd715de6f39980eec9f7..873d7b1d4e26ff9a05a96d4b0d75fa8dbdae658e 100644 (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 (;;) {