[packages] tslib: Don't use freed device string.

git-svn-id: svn://svn.openwrt.org/openwrt/packages@18081 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
lars 2009-10-19 20:03:16 +00:00
parent b35b2e9a6b
commit ca5710b724

View File

@ -0,0 +1,18 @@
--- a/src/tslib.c
+++ b/src/tslib.c
@@ -372,13 +394,14 @@ xf86TslibInit(InputDriverPtr drv, IDevPtr dev, int flags)
s = xf86SetStrOption(pInfo->options, "Device", NULL);
priv->ts = ts_open(s, 0);
- xfree(s);
if (!priv->ts) {
ErrorF("ts_open failed (device=%s)\n",s);
xf86DeleteInput(pInfo, 0);
+ xfree(s);
return NULL;
}
+ xfree(s);
if (ts_config(priv->ts)) {
ErrorF("ts_config failed\n");