virNetDevBandwidthParseRate(xmlNodePtr node, virNetDevBandwidthRatePtr rate)
{
int ret = -1;
- char *average = NULL;
- char *peak = NULL;
- char *burst = NULL;
- char *floor = NULL;
+ g_autofree char *average = NULL;
+ g_autofree char *peak = NULL;
+ g_autofree char *burst = NULL;
+ g_autofree char *floor = NULL;
if (!node || !rate) {
virReportError(VIR_ERR_INVALID_ARG, "%s",
ret = 0;
cleanup:
- VIR_FREE(average);
- VIR_FREE(peak);
- VIR_FREE(burst);
- VIR_FREE(floor);
-
return ret;
}
virNetDevBandwidthPtr def = NULL;
xmlNodePtr cur;
xmlNodePtr in = NULL, out = NULL;
- char *class_id_prop = NULL;
+ g_autofree char *class_id_prop = NULL;
def = g_new0(virNetDevBandwidth, 1);
ret = 0;
cleanup:
- VIR_FREE(class_id_prop);
virNetDevBandwidthFree(def);
return ret;
}