|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH 1/4] cache: Fix memory leak in failure path
On 09/09/2025 14:22, Owen Smith wrote:
> From: david ambu <david.preetham@xxxxxxxxx>
>
> In certain error paths, the context memory was not being released,
> causing a potential memory leak. Ensure that __CacheFree() is called
> on failure to properly release resources and reset the context.
> Free Context during failure paths.
>
> Signed-off-by: david ambu <david.preetham@xxxxxxxxx>
>
> Added blank line, split patch and modified commit message
>
> Signed-off-by: Owen Smith <owen.smith@xxxxxxxxx>
All four patches:
Reviewed-by: Tu Dinh <ngoc-tu.dinh@xxxxxxxxxx>
> ---
> src/xenbus/cache.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/src/xenbus/cache.c b/src/xenbus/cache.c
> index d60ae29..e61033d 100644
> --- a/src/xenbus/cache.c
> +++ b/src/xenbus/cache.c
> @@ -1275,6 +1275,9 @@ fail2:
> RtlZeroMemory(&(*Context)->DebugInterface,
> sizeof (XENBUS_DEBUG_INTERFACE));
>
> + __CacheFree(*Context);
> + *Context = NULL;
> +
> fail1:
> Error("fail1 (%08x)\n", status);
>
--
Ngoc Tu Dinh | Vates XCP-ng Developer
XCP-ng & Xen Orchestra - Vates solutions
web: https://vates.tech
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |