When undefining a domain with storage when the volume isn't managed by
libvirt the name and path strings weren't freed properly.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=996050
for (i = 0; i < nvolumes; i++) {
ctxt->node = vol_nodes[i];
+ VIR_FREE(source);
+ VIR_FREE(target);
/* get volume source and target paths */
if (!(target = virXPathString("string(./target/@dev)", ctxt)))
}
vlist[nvols].source = source;
vlist[nvols].target = target;
+ source = NULL;
+ target = NULL;
nvols++;
}
}
cleanup:
+ VIR_FREE(source);
+ VIR_FREE(target);
for (i = 0; i < nvols; i++) {
VIR_FREE(vlist[i].source);
VIR_FREE(vlist[i].target);