compositor-rdp: rdp_destroy() double free error #91457
authorDawid Gajownik <gajownik@gmail.com>
Wed, 5 Aug 2015 20:21:28 +0000 (17:21 -0300)
committerDaniel Stone <daniels@collabora.com>
Thu, 6 Aug 2015 15:10:57 +0000 (16:10 +0100)
commit405ae2febaa3f1a6de5bd0eb65d9a6a811040cc9
treeda98c64ebf084f9997661abd567e279d39428ba9
parent0b2bcbf3e3398ee187082a8d225695f06c97b63c
compositor-rdp: rdp_destroy() double free error #91457

When something goes wrong during weston initialization,
weston_compositor_destroy() is executed. It destroys the backend and
then frees compositor memory. Unfortunately RDP backend is not correctly
destroyed. It frees compositor instead of a backend memory. This causes
later a double free error. The easiest way to reproduce a problem is to
run weston with an invalid option.

Additionally some other objects of rdp_backend structure are not
destroyed/freed. The patch fixes both issues.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=91457

v3: comply with Weston coding style, this time for real
v2: comply with Weston coding style

Signed-off-by: Dawid Gajownik <gajownik@gmail.com>
Reviewed-by: David FORT <contact@hardening-consulting.com>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
src/compositor-rdp.c