[PATCH] virCapabilitiesFormatCaches: free cpus_str right after use

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

 



This will simplify the cleanup when we start checking for
buffer errors.
---
Pushed as trivial.

 src/conf/capabilities.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/conf/capabilities.c b/src/conf/capabilities.c
index 0f99f3096..561a6cf9e 100644
--- a/src/conf/capabilities.c
+++ b/src/conf/capabilities.c
@@ -904,6 +904,7 @@ virCapabilitiesFormatCaches(virBufferPtr buf,
                           bank->size >> (kilos * 10),
                           kilos ? "KiB" : "B",
                           cpus_str);
+        VIR_FREE(cpus_str);
 
         virBufferAdjustIndent(&controlBuf, indent + 4);
         for (j = 0; j < bank->ncontrols; j++) {
@@ -937,8 +938,6 @@ virCapabilitiesFormatCaches(virBufferPtr buf,
         } else {
             virBufferAddLit(buf, "/>\n");
         }
-
-        VIR_FREE(cpus_str);
     }
 
     virBufferAdjustIndent(buf, -2);
-- 
2.13.0

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[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