From 0b325d64f4951c7541a4ad434e99034b04d8f70c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Fri, 10 Jun 2022 22:51:56 +0200 Subject: [PATCH] kms/impl-device/atomic: Don't leak drm commit request on error Part-of: --- src/backends/native/meta-kms-impl-device-atomic.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/backends/native/meta-kms-impl-device-atomic.c b/src/backends/native/meta-kms-impl-device-atomic.c index e938e4522..b15f81849 100644 --- a/src/backends/native/meta-kms-impl-device-atomic.c +++ b/src/backends/native/meta-kms-impl-device-atomic.c @@ -1019,7 +1019,6 @@ meta_kms_impl_device_atomic_process_update (MetaKmsImplDevice *impl_device, fd = meta_kms_impl_device_get_fd (impl_device); ret = drmModeAtomicCommit (fd, req, commit_flags, impl_device); - drmModeAtomicFree (req); if (ret < 0) { g_set_error (&error, G_IO_ERROR, g_io_error_from_errno (-ret), @@ -1027,6 +1026,8 @@ meta_kms_impl_device_atomic_process_update (MetaKmsImplDevice *impl_device, goto err; } + drmModeAtomicFree (req); + process_entries (impl_device, update, req, @@ -1055,6 +1056,9 @@ err: NULL); } + if (req) + drmModeAtomicFree (req); + release_blob_ids (impl_device, blob_ids); return meta_kms_feedback_new_failed (failed_planes, error);