[PATCH i-g-t 3/8] lib/igt_drm_clients: Fix leaks
Lucas De Marchi
lucas.demarchi at intel.com
Tue Apr 2 22:17:11 UTC 2024
Stop leaking memory-related fields.
Signed-off-by: Lucas De Marchi <lucas.demarchi at 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