diff options
| author | Claudio Takahasi <claudio.takahasi@openbossa.org> | 2007-04-18 19:33:34 +0000 | 
|---|---|---|
| committer | Claudio Takahasi <claudio.takahasi@openbossa.org> | 2007-04-18 19:33:34 +0000 | 
| commit | c506053c991016d372948a912201fdc8b03d175f (patch) | |
| tree | 57ffd2e505a13ff6d9132d4401de5fc0032564c7 /input/manager.c | |
| parent | f8c373978d73cd848240744acce657861f5a13f2 (diff) | |
input: fixed seg fault when RemoveDevice is called and there is a pending connection request
Diffstat (limited to 'input/manager.c')
| -rw-r--r-- | input/manager.c | 12 | 
1 files changed, 7 insertions, 5 deletions
| diff --git a/input/manager.c b/input/manager.c index 41bafd20..f9c273fe 100644 --- a/input/manager.c +++ b/input/manager.c @@ -827,6 +827,7 @@ static DBusHandlerResult remove_device(DBusConnection *conn,  	DBusError derr;  	GSList *l;  	const char *path; +	int err;  	dbus_error_init(&derr);  	if (!dbus_message_get_args(msg, &derr, @@ -845,14 +846,15 @@ static DBusHandlerResult remove_device(DBusConnection *conn,  	if (!reply)  		return DBUS_HANDLER_RESULT_NEED_MEMORY; -	g_free(l->data); -	device_paths = g_slist_remove(device_paths, l->data); - -	if (input_device_unregister(conn, path) < 0) { +	err = input_device_unregister(conn, path); +	if (err < 0) {  		dbus_message_unref(reply); -		return err_failed(conn, msg, "D-Bus path unregistration failed"); +		return err_failed(conn, msg, strerror(-err));  	} +	g_free(l->data); +	device_paths = g_slist_remove(device_paths, l->data); +  	return send_message_and_unref(conn, reply);  } | 
