diff options
author | Jukka Rissanen <jukka.rissanen@linux.intel.com> | 2013-03-07 18:13:45 +0200 |
---|---|---|
committer | Patrik Flykt <patrik.flykt@linux.intel.com> | 2013-03-08 13:50:18 +0200 |
commit | 76e97ed5506da5b88111a9b2a3cdcaa4f6d8c43d (patch) | |
tree | 312cc0b047966bc3dcc375b499d7eb057bc7d14e | |
parent | de460f095ede26b71270e7e122c4b88932860f2a (diff) | |
download | connman-76e97ed5506da5b88111a9b2a3cdcaa4f6d8c43d.tar.gz connman-76e97ed5506da5b88111a9b2a3cdcaa4f6d8c43d.tar.bz2 connman-76e97ed5506da5b88111a9b2a3cdcaa4f6d8c43d.zip |
vpn: Make sure vpn connection really exists before removing it
-rw-r--r-- | plugins/vpn.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/plugins/vpn.c b/plugins/vpn.c index 04318a96..038a8338 100644 --- a/plugins/vpn.c +++ b/plugins/vpn.c @@ -1508,6 +1508,7 @@ static gboolean connection_removed(DBusConnection *conn, DBusMessage *message, { const char *path; const char *signature = DBUS_TYPE_OBJECT_PATH_AS_STRING; + struct connection_data *data; if (dbus_message_has_signature(message, signature) == FALSE) { connman_error("vpn removed signature \"%s\" does not match " @@ -1518,7 +1519,11 @@ static gboolean connection_removed(DBusConnection *conn, DBusMessage *message, dbus_message_get_args(message, NULL, DBUS_TYPE_OBJECT_PATH, &path, DBUS_TYPE_INVALID); - remove_connection(conn, path); + + data = g_hash_table_lookup(vpn_connections, get_ident(path)); + if (data != NULL) + remove_connection(conn, path); + return TRUE; } |