summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorDaniel Wagner <daniel.wagner@bmw-carit.de>2011-03-15 15:02:08 +0100
committerSamuel Ortiz <sameo@linux.intel.com>2011-03-16 10:29:29 +0100
commitd8549da847d093dda21063077d3bc5fc5f63a4e3 (patch)
tree172f2f367e23c52aafc0718306b896f8ec143264 /plugins
parent62ba22e534278165d688374e506da5873165b6be (diff)
downloadconnman-d8549da847d093dda21063077d3bc5fc5f63a4e3.tar.gz
connman-d8549da847d093dda21063077d3bc5fc5f63a4e3.tar.bz2
connman-d8549da847d093dda21063077d3bc5fc5f63a4e3.zip
ofono: Free network_info
The network_info data structure is not freed. Also the error path does not handle the freeing of the data structure correctly. Reported by: Henri Bragge <henri.bragge@ixonos.com>
Diffstat (limited to 'plugins')
-rw-r--r--plugins/ofono.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/plugins/ofono.c b/plugins/ofono.c
index 3f4e9867..3e71441a 100644
--- a/plugins/ofono.c
+++ b/plugins/ofono.c
@@ -362,6 +362,8 @@ static void remove_network(gpointer data)
struct network_info *info = data;
connman_network_unref(info->network);
+
+ g_free(info);
}
static char *get_ident(const char *path)
@@ -604,8 +606,11 @@ static int add_network(struct connman_device *device,
connman_network_set_string(network, "Path", path);
hash_path = connman_network_get_string(network, "Path");
- if (hash_path == NULL)
- goto error;
+ if (hash_path == NULL) {
+ connman_network_unref(network);
+ g_free(info);
+ return -EIO;
+ }
create_service(network);
@@ -1721,7 +1726,7 @@ static gboolean context_changed(DBusConnection *connection,
return TRUE;
if (!pending_network_is_available(info->network)) {
- remove_network(info->network);
+ g_hash_table_remove(network_hash, path);
return TRUE;
}