virCapabilitiesFormatCaches: free cpus_str right after use

This will simplify the cleanup when we start checking for
buffer errors.
This commit is contained in:
Ján Tomko 2017-08-02 15:38:40 +02:00
parent 2074ef6cd4
commit 2403dcce51

View File

@ -904,6 +904,7 @@ virCapabilitiesFormatCaches(virBufferPtr buf,
bank->size >> (kilos * 10), bank->size >> (kilos * 10),
kilos ? "KiB" : "B", kilos ? "KiB" : "B",
cpus_str); cpus_str);
VIR_FREE(cpus_str);
virBufferAdjustIndent(&controlBuf, indent + 4); virBufferAdjustIndent(&controlBuf, indent + 4);
for (j = 0; j < bank->ncontrols; j++) { for (j = 0; j < bank->ncontrols; j++) {
@ -937,8 +938,6 @@ virCapabilitiesFormatCaches(virBufferPtr buf,
} else { } else {
virBufferAddLit(buf, "/>\n"); virBufferAddLit(buf, "/>\n");
} }
VIR_FREE(cpus_str);
} }
virBufferAdjustIndent(buf, -2); virBufferAdjustIndent(buf, -2);