The @alloc object returned by virDomainResctrlVcpuMatch is not
properly referenced and un-referenced in virDomainCachetuneDefParse.
This patch fixes this problem.
Signed-off-by: Wang Huaqiang <huaqiang.wang@intel.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
* Just updating memory allocation information of that group
*/
if (virBitmapEqual(def->resctrls[i]->vcpus, vcpus)) {
- *alloc = def->resctrls[i]->alloc;
+ *alloc = virObjectRef(def->resctrls[i]->alloc);
break;
}
if (virBitmapOverlaps(def->resctrls[i]->vcpus, vcpus)) {
if (!alloc)
goto cleanup;
new_alloc = true;
- } else {
- alloc = virObjectRef(alloc);
}
for (i = 0; i < n; i++) {