[libvirt PATCH 06/10] virBufferAddBuffer: Cleanup

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Remove unnecessary label and goto.

Signed-off-by: Tim Wiederhake <twiederh@xxxxxxxxxx>
---
 src/util/virbuffer.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/src/util/virbuffer.c b/src/util/virbuffer.c
index 8f9cd57e06..a4834174a1 100644
--- a/src/util/virbuffer.c
+++ b/src/util/virbuffer.c
@@ -185,13 +185,11 @@ virBufferAddBuffer(virBuffer *buf, virBuffer *toadd)
     if (!toadd || !toadd->str)
         return;
 
-    if (!buf)
-        goto cleanup;
-
-    virBufferInitialize(buf);
-    g_string_append_len(buf->str, toadd->str->str, toadd->str->len);
+    if (buf) {
+        virBufferInitialize(buf);
+        g_string_append_len(buf->str, toadd->str->str, toadd->str->len);
+    }
 
- cleanup:
     virBufferFreeAndReset(toadd);
 }
 
-- 
2.31.1




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux