lxcContainerRenameAndEnableInterfaces() isn't making a copy of the
interface's ifname_guest (into newname), it's just copying the pointer
to it. This means that when it later calls VIR_FREE(newname), it's
actually freeing up (and fortunately NULLing out, so at least we don't
try to access free'd memory) netDef->ifname_guest.
{
int rc = 0;
size_t i, j;
- char *newname = NULL;
+ const char *newname;
char *toStr = NULL;
char *viaStr = NULL;
virDomainNetDefPtr netDef;
VIR_FREE(viaStr);
}
}
-
- VIR_FREE(newname);
}
/* enable lo device only if there were other net devices */
error_out:
VIR_FREE(toStr);
VIR_FREE(viaStr);
- VIR_FREE(newname);
return rc;
}