summaryrefslogtreecommitdiff
path: root/plugins/vpn.c
diff options
context:
space:
mode:
authorPatrik Flykt <patrik.flykt@linux.intel.com>2012-01-25 13:49:39 +0200
committerSamuel Ortiz <sameo@linux.intel.com>2012-01-27 11:21:24 +0100
commit57b5f962c298199d9ff1b99a04a2fbddd98e8eeb (patch)
tree258b4a60d8eef5df6a7ba714217798d6ce5ef653 /plugins/vpn.c
parent69e9601413d310a4dfc4b41944a0a34b94ddb4c5 (diff)
downloadconnman-57b5f962c298199d9ff1b99a04a2fbddd98e8eeb.tar.gz
connman-57b5f962c298199d9ff1b99a04a2fbddd98e8eeb.tar.bz2
connman-57b5f962c298199d9ff1b99a04a2fbddd98e8eeb.zip
vpn: Add check for properly initialized driver_hash
Diffstat (limited to 'plugins/vpn.c')
-rw-r--r--plugins/vpn.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/plugins/vpn.c b/plugins/vpn.c
index 9f49f321..a6ac5b90 100644
--- a/plugins/vpn.c
+++ b/plugins/vpn.c
@@ -484,10 +484,15 @@ int vpn_register(const char *name, struct vpn_driver *vpn_driver,
data->provider_driver.remove = vpn_remove;
data->provider_driver.save = vpn_save;
- if (driver_hash == NULL) {
+ if (driver_hash == NULL)
driver_hash = g_hash_table_new_full(g_str_hash,
g_str_equal,
NULL, g_free);
+
+ if (driver_hash == NULL) {
+ connman_error("driver_hash not initialized for %s", name);
+ g_free(data);
+ return -ENOMEM;
}
g_hash_table_insert(driver_hash, (char *)name, data);