summaryrefslogtreecommitdiff
path: root/src/session.c
diff options
context:
space:
mode:
authorDaniel Wagner <daniel.wagner@bmw-carit.de>2013-04-18 09:07:25 +0200
committerPatrik Flykt <patrik.flykt@linux.intel.com>2013-04-18 14:17:05 +0300
commitc6025eca557d82d9514108ede6ba0aa266746e64 (patch)
treea56a714d607384cf92498bca965d7617df3b35ac /src/session.c
parent1d1f9c7ccabdcaa74cdb5c4c791fc2bdb32ec42b (diff)
downloadconnman-c6025eca557d82d9514108ede6ba0aa266746e64.tar.gz
connman-c6025eca557d82d9514108ede6ba0aa266746e64.tar.bz2
connman-c6025eca557d82d9514108ede6ba0aa266746e64.zip
session: Do not fail when creating default policy configuration
Do not handle the small alloc failures because glib will abort when memory is tight anyway.
Diffstat (limited to 'src/session.c')
-rw-r--r--src/session.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/src/session.c b/src/session.c
index 5a6065f6..07db2f12 100644
--- a/src/session.c
+++ b/src/session.c
@@ -410,7 +410,7 @@ void connman_session_policy_unregister(struct connman_session_policy *policy)
remove_policy(policy);
}
-int connman_session_set_default_config(struct connman_session_config *config)
+void connman_session_set_default_config(struct connman_session_config *config)
{
config->priority = FALSE;
config->roaming_policy = CONNMAN_SESSION_ROAMING_POLICY_DEFAULT;
@@ -420,24 +420,14 @@ int connman_session_set_default_config(struct connman_session_config *config)
g_slist_free(config->allowed_bearers);
config->allowed_bearers = g_slist_prepend(NULL,
GINT_TO_POINTER(CONNMAN_SERVICE_TYPE_UNKNOWN));
- if (config->allowed_bearers == NULL)
- return -ENOMEM;
-
- return 0;
}
struct connman_session_config *connman_session_create_default_config(void)
{
struct connman_session_config *config;
- config = g_try_new0(struct connman_session_config, 1);
- if (config == NULL)
- return NULL;
-
- if (connman_session_set_default_config(config) < 0) {
- g_free(config);
- return NULL;
- }
+ config = g_new0(struct connman_session_config, 1);
+ connman_session_set_default_config(config);
return config;
}