|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH 1/7] tools/xenguest: Dynamically allocate xc_cpu_policy_t contents
On Tue, Nov 07, 2023 at 03:49:15PM +0000, Alejandro Vallejo wrote:
> void xc_cpu_policy_destroy(xc_cpu_policy_t *policy)
> {
> - if ( policy )
> - free(policy);
> + int err = errno;
> +
> + if ( !policy )
> + return;
> +
> + if ( policy->leaves.buf )
> + free(policy->leaves.buf);
> + if ( policy->msrs.buf )
> + free(policy->msrs.buf);
FYI: free() already check for NULL, so the extra if() is unnecessary.
Otherwise, patch looks fine:
Reviewed-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
Thanks,
--
Anthony PERARD
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |