In preparation for using auto free mechanism, change to using the
VIR_STEAL_PTR on @def to @ret and of course be sure to properly clean
up @def in cleanup.
Signed-off-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
virDomainEmulatorPinDefParseXML(xmlNodePtr node)
{
virBitmapPtr def = NULL;
+ virBitmapPtr ret = NULL;
char *tmp = NULL;
if (!(tmp = virXMLPropString(node, "cpuset"))) {
if (virBitmapIsAllClear(def)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("Invalid value of 'cpuset': %s"), tmp);
- virBitmapFree(def);
- def = NULL;
goto cleanup;
}
+ VIR_STEAL_PTR(ret, def);
+
cleanup:
+ virBitmapFree(def);
VIR_FREE(tmp);
- return def;
+ return ret;
}