vdagent-x11: Fix crash on vdagend restart (rhbz#894365)
commitf269ec359e0a9f7c11659af9e8121f7e8e714060
authorHans de Goede <hdegoede@redhat.com>
Fri, 18 Jan 2013 09:00:12 +0000 (18 10:00 +0100)
committerHans de Goede <hdegoede@redhat.com>
Fri, 18 Jan 2013 09:00:12 +0000 (18 10:00 +0100)
tree4bf3c0c15d2a4304e3c002f1025ff0aac9c22831
parent5c2de0012f3ce30fe958b05db0549dbd37d4bb6d
vdagent-x11: Fix crash on vdagend restart (rhbz#894365)

vdagent_x11_destroy() cleans up clipboard state and will tell the client
it is releasing the clipboard if it owns it. But when the vdagentd is
restarted the unix socket is disconnected and x11->vdagentd points to
already free-ed memory, leading to a crash.

This patch fixes this by not trying to send messages to the client on
cleanup when the unix socket is disconnected.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
src/vdagent-x11.c
src/vdagent-x11.h
src/vdagent.c