Cleanup was missing for libvirt-allocated virDomainPtr.
Change-Id: Ied152e9e4084ee9e25b7357e648a6aac8778d09b
Signed-off-by: Radoslaw Jablonski <radoslawx.jablonski@intel.com>
continue;
}
status = virDomainGetInfo(dom, &info);
- if (status != 0) {
+ if (status == 0)
+ /* virDomainGetState is not available. Submit 0, which corresponds to
+ * unknown reason. */
+ domain_state_submit_notif(dom, info.state, 0);
+ else
ERROR(PLUGIN_NAME " plugin: virDomainGetInfo failed with status %i.",
status);
- continue;
- }
- /* virDomainGetState is not available. Submit 0, which corresponds to
- * unknown reason. */
- domain_state_submit_notif(dom, info.state, 0);
+
+ virDomainFree(dom);
}
sfree(domids);
}