From ed3387c4defc0e7a1043b99029f004ce08a53dbb Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 8 Dec 2010 16:07:13 +1000 Subject: Don't free the device info on a failed PreInit. This data is later freed when the xserver calls UnInit(). Freeing too early means we segfault later when trying to dereference null-pointers. Signed-off-by: Peter Hutterer (cherry picked from commit 799bbf2cf9cd54942c66f9117df319e933bbd10b) Conflicts: src/wcmConfig.c Signed-off-by: Peter Hutterer --- src/wcmConfig.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/wcmConfig.c b/src/wcmConfig.c index 3c183f0..f8aac5a 100644 --- a/src/wcmConfig.c +++ b/src/wcmConfig.c @@ -444,17 +444,11 @@ SetupProc_fail: /* restart the device list from the next one */ if (common && priv) common->wcmDevices = priv->next; - free(common); - free(priv); - if (pInfo) - { - if (pInfo->fd != -1) - { - close(pInfo->fd); - pInfo->fd = -1; - } - pInfo->private = NULL; + if (pInfo && pInfo->fd != -1) + { + close(pInfo->fd); + pInfo->fd = -1; } return BadMatch; -- cgit v1.2.1