diff --git a/plugins/platforms/drm/drm_backend.cpp b/plugins/platforms/drm/drm_backend.cpp index e5bad20442..48a69ad43b 100644 --- a/plugins/platforms/drm/drm_backend.cpp +++ b/plugins/platforms/drm/drm_backend.cpp @@ -298,7 +298,7 @@ void DrmBackend::openDrm() // create the plane objects for (unsigned int i = 0; i < planeResources->count_planes; ++i) { - drmModePlane *kplane = drmModeGetPlane(m_fd, planeResources->planes[i]); + DrmScopedPointer kplane(drmModeGetPlane(m_fd, planeResources->planes[i])); DrmPlane *p = new DrmPlane(kplane->plane_id, m_fd); if (p->atomicInit()) { m_planes << p;