diff options
author | Patrik Flykt <patrik.flykt@linux.intel.com> | 2012-01-25 13:49:39 +0200 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2012-01-27 11:21:24 +0100 |
commit | 57b5f962c298199d9ff1b99a04a2fbddd98e8eeb (patch) | |
tree | 258b4a60d8eef5df6a7ba714217798d6ce5ef653 /plugins | |
parent | 69e9601413d310a4dfc4b41944a0a34b94ddb4c5 (diff) | |
download | connman-57b5f962c298199d9ff1b99a04a2fbddd98e8eeb.tar.gz connman-57b5f962c298199d9ff1b99a04a2fbddd98e8eeb.tar.bz2 connman-57b5f962c298199d9ff1b99a04a2fbddd98e8eeb.zip |
vpn: Add check for properly initialized driver_hash
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/vpn.c | 7 |
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); |