From a475f99d89f5f9615c31400f4a7126be871c3152 Mon Sep 17 00:00:00 2001 From: Daniel Wagner Date: Wed, 31 Oct 2012 10:33:30 +0100 Subject: session: Policy register should check callback existence Let's ensure that the policy plugin has all necessary callbacks installed when connman_session_policy_register() is called. The rest of the code expects that the create() and destroy() callbacks exist whenever a plugin is used. --- src/session.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/session.c b/src/session.c index c981befa..2b06e3f3 100644 --- a/src/session.c +++ b/src/session.c @@ -314,6 +314,9 @@ int connman_session_policy_register(struct connman_session_policy *policy) { DBG("name %s", policy->name); + if (policy->create == NULL || policy->destroy == NULL) + return -EINVAL; + policy_list = g_slist_insert_sorted(policy_list, policy, compare_priority); -- cgit v1.2.3