[PATCH 10/19] xfree86: plug minor memory leak.

Peter Hutterer peter.hutterer at who-t.net
Sun Sep 5 19:52:46 PDT 2010


When no identifier for the device was specified, the allocated IDevRec (and
its associated fields) need to be freed.

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 hw/xfree86/common/xf86Xinput.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c
index a34ecc1..0aa9c42 100644
--- a/hw/xfree86/common/xf86Xinput.c
+++ b/hw/xfree86/common/xf86Xinput.c
@@ -911,7 +911,8 @@ NewInputDeviceRequest (InputOption *options, InputAttributes *attrs,
 
     if (!idev->identifier) {
         xf86Msg(X_ERROR, "No device identifier specified (ignoring)\n");
-        return BadMatch;
+        rval = BadMatch;
+        goto unwind;
     }
 
     rval = xf86NewInputDevice(idev, pdev,
-- 
1.7.2.2



More information about the xorg-devel mailing list