void *opaque)
{
int ret = -1;
- char *old_name = NULL;
+ g_autofree char *old_name = NULL;
int rc;
if (STREQ(dom->def->name, new_name)) {
ret = 0;
cleanup:
virObjectRWUnlock(doms);
- VIR_FREE(old_name);
return ret;
}
virDomainLoadConfigNotify notify,
void *opaque)
{
- char *configFile = NULL, *autostartLink = NULL;
+ g_autofree char *configFile = NULL;
+ g_autofree char *autostartLink = NULL;
virDomainDef *def = NULL;
virDomainObj *dom;
int autostart;
(*notify)(dom, oldDef == NULL, opaque);
virDomainDefFree(oldDef);
- VIR_FREE(configFile);
- VIR_FREE(autostartLink);
return dom;
error:
- VIR_FREE(configFile);
- VIR_FREE(autostartLink);
virDomainDefFree(def);
return NULL;
}
virDomainLoadConfigNotify notify,
void *opaque)
{
- char *statusFile = NULL;
+ g_autofree char *statusFile = NULL;
virDomainObj *obj = NULL;
char uuidstr[VIR_UUID_STRING_BUFLEN];
if (notify)
(*notify)(obj, 1, opaque);
- VIR_FREE(statusFile);
return obj;
error:
virDomainObjEndAPI(&obj);
- VIR_FREE(statusFile);
return NULL;
}