projects
/
platform
/
upstream
/
connman.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
69e9601
)
vpn: Add check for properly initialized driver_hash
author
Patrik Flykt
<patrik.flykt@linux.intel.com>
Wed, 25 Jan 2012 11:49:39 +0000
(13:49 +0200)
committer
Samuel Ortiz
<sameo@linux.intel.com>
Fri, 27 Jan 2012 10:21:24 +0000
(11:21 +0100)
plugins/vpn.c
patch
|
blob
|
history
diff --git
a/plugins/vpn.c
b/plugins/vpn.c
index
9f49f32
..
a6ac5b9
100644
(file)
--- 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);