diff options
| author | Claudio Takahasi <claudio.takahasi@openbossa.org> | 2006-11-08 18:52:20 +0000 | 
|---|---|---|
| committer | Claudio Takahasi <claudio.takahasi@openbossa.org> | 2006-11-08 18:52:20 +0000 | 
| commit | 34a3fbf5f13e556e2a6e0c91a28b4a857ec67b62 (patch) | |
| tree | 09dfea4396141a11202b93d78f8c93777cb91a40 /hcid/dbus-service.c | |
| parent | 6bf68118fef86f78d7e8450ea43de45a73a33921 (diff) | |
Prevent segmentation fault if the D-Bus path data is NULL
Diffstat (limited to 'hcid/dbus-service.c')
| -rw-r--r-- | hcid/dbus-service.c | 6 | 
1 files changed, 4 insertions, 2 deletions
diff --git a/hcid/dbus-service.c b/hcid/dbus-service.c index 34602846..9286837f 100644 --- a/hcid/dbus-service.c +++ b/hcid/dbus-service.c @@ -283,7 +283,7 @@ static void service_agent_exit(const char *name, void *data)  		if (!dbus_connection_get_object_path_data(conn, path, (void *) &agent))  			continue; -		if (strcmp(name, agent->id)) +		if (!agent || strcmp(name, agent->id))  			continue;  		if (agent->records) @@ -305,7 +305,6 @@ static void service_agent_exit(const char *name, void *data)  	slist_foreach(lremove, (slist_func_t) free, NULL);  	slist_free(lremove); -  }  static void forward_reply(DBusPendingCall *call, void *udata) @@ -808,6 +807,9 @@ void release_service_agents(DBusConnection *conn)  		l = l->next;  		if (dbus_connection_get_object_path_data(conn, path, (void *) &agent)) { +			if (!agent) +				continue; +  			send_release(conn, agent->id, path);  			service_agent_free(agent);  		}  | 
