xfree86: fix minor memory leak
xf86*StrOption returns a strdup Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
This commit is contained in:
parent
51984dddfc
commit
71ba826901
|
@ -843,7 +843,7 @@ xf86NewInputDevice(InputInfoPtr pInfo, DeviceIntPtr *pdev, BOOL enable)
|
||||||
DeviceIntPtr dev = NULL;
|
DeviceIntPtr dev = NULL;
|
||||||
Bool paused;
|
Bool paused;
|
||||||
int rval;
|
int rval;
|
||||||
const char *path;
|
char *path = NULL;
|
||||||
|
|
||||||
/* Memory leak for every attached device if we don't
|
/* Memory leak for every attached device if we don't
|
||||||
* test if the module is already loaded first */
|
* test if the module is already loaded first */
|
||||||
|
@ -873,6 +873,7 @@ xf86NewInputDevice(InputInfoPtr pInfo, DeviceIntPtr *pdev, BOOL enable)
|
||||||
new_input_devices[new_input_devices_count] = pInfo;
|
new_input_devices[new_input_devices_count] = pInfo;
|
||||||
new_input_devices_count++;
|
new_input_devices_count++;
|
||||||
systemd_logind_release_fd(pInfo->major, pInfo->minor, fd);
|
systemd_logind_release_fd(pInfo->major, pInfo->minor, fd);
|
||||||
|
free(path);
|
||||||
return BadMatch;
|
return BadMatch;
|
||||||
}
|
}
|
||||||
pInfo->fd = fd;
|
pInfo->fd = fd;
|
||||||
|
@ -881,6 +882,8 @@ xf86NewInputDevice(InputInfoPtr pInfo, DeviceIntPtr *pdev, BOOL enable)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
free(path);
|
||||||
|
|
||||||
xf86Msg(X_INFO, "Using input driver '%s' for '%s'\n", drv->driverName,
|
xf86Msg(X_INFO, "Using input driver '%s' for '%s'\n", drv->driverName,
|
||||||
pInfo->name);
|
pInfo->name);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue