]> xenbits.xensource.com Git - libvirt.git/commitdiff
util: Use virBufferCheckError to its full potential.
authorMartin Kletzander <mkletzan@redhat.com>
Mon, 21 Aug 2017 06:38:34 +0000 (08:38 +0200)
committerMartin Kletzander <mkletzan@redhat.com>
Tue, 29 Aug 2017 09:17:16 +0000 (11:17 +0200)
We can now check for the error and not care about the return value as
it will be properly handled in virBufferContentAndReset() anyway.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
src/util/virbitmap.c

index a5077fe7c8bfbcfdbce8a06ac20187b71a8ae8ad..57a8fbf82c78c01da17049959d73aa30e1625b22 100644 (file)
@@ -332,11 +332,7 @@ char *virBitmapString(virBitmapPtr bitmap)
                           bitmap->map[sz]);
     }
 
-    if (virBufferError(&buf)) {
-        virBufferFreeAndReset(&buf);
-        return NULL;
-    }
-
+    virBufferCheckError(&buf);
     return virBufferContentAndReset(&buf);
 }