summaryrefslogtreecommitdiff
path: root/plugins/ofono.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/ofono.c')
-rw-r--r--plugins/ofono.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/plugins/ofono.c b/plugins/ofono.c
index 0c234623..1b9264ac 100644
--- a/plugins/ofono.c
+++ b/plugins/ofono.c
@@ -366,6 +366,7 @@ static void remove_network(gpointer data)
{
struct network_info *info = data;
+ connman_network_unregister(info->network);
connman_network_unref(info->network);
g_free(info);
@@ -831,8 +832,11 @@ static int add_network(struct connman_device *device,
if (network == NULL)
return -ENOMEM;
+ connman_network_register(network);
+
info = g_try_new0(struct network_info, 1);
if (info == NULL) {
+ connman_network_unregister(network);
connman_network_unref(network);
return -ENOMEM;
}
@@ -903,6 +907,7 @@ static int add_network(struct connman_device *device,
return 0;
error:
+ connman_network_unregister(network);
connman_network_unref(network);
g_hash_table_remove(network_hash, hash_path);
return -EIO;