xen: fix usage of kern_getenv in PVH code

The value returned by kern_getenv should be freed using freeenv.

Reported by:	Coverity
CID:		1248852
Sponsored by: Citrix Systems R&D
This commit is contained in:
Roger Pau Monné 2014-10-22 16:49:00 +00:00
parent a178d09eee
commit b2537024be
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=273472

View File

@ -306,11 +306,14 @@ static void
xen_pv_set_boothowto(void)
{
int i;
char *env;
/* get equivalents from the environment */
for (i = 0; howto_names[i].ev != NULL; i++) {
if (kern_getenv(howto_names[i].ev) != NULL)
if ((env = kern_getenv(howto_names[i].ev)) != NULL) {
boothowto |= howto_names[i].mask;
freeenv(env);
}
}
}