[PATCH i-g-t 3/8] lib/igt_drm_clients: Fix leaks
Kamil Konieczny
kamil.konieczny at linux.intel.com
Wed Apr 3 17:26:48 UTC 2024
Hi Lucas,
On 2024-04-02 at 15:17:11 -0700, Lucas De Marchi wrote:
> Stop leaking memory-related fields.
>
> Signed-off-by: Lucas De Marchi <lucas.demarchi at intel.com>
Reviewed-by: Kamil Konieczny <kamil.konieczny at linux.intel.com>
> ---
> lib/igt_drm_clients.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/lib/igt_drm_clients.c b/lib/igt_drm_clients.c
> index c8dc21d6a..c174c96ab 100644
> --- a/lib/igt_drm_clients.c
> +++ b/lib/igt_drm_clients.c
> @@ -221,9 +221,19 @@ void igt_drm_client_free(struct igt_drm_client *c, bool clear)
> free(c->engines->names);
> }
> free(c->engines);
> +
> free(c->val);
> free(c->last);
>
> + if (c->regions) {
> + for (i = 0; i <= c->regions->max_region_id; i++)
> + free(c->regions->names[i]);
> + free(c->regions->names);
> + }
> + free(c->regions);
> +
> + free(c->memory);
> +
> if (clear)
> memset(c, 0, sizeof(*c));
> }
> --
> 2.43.0
>
More information about the igt-dev
mailing list