summaryrefslogtreecommitdiff
path: root/plugins/vpn.c
diff options
context:
space:
mode:
authorDaniel Wagner <daniel.wagner@bmw-carit.de>2011-03-17 14:25:38 +0100
committerSamuel Ortiz <sameo@linux.intel.com>2011-03-17 17:48:15 +0100
commit495bee89661d32ae27c0baa16e576c1229e20701 (patch)
treef8a255b98a06420c04c467a567e8348fcc158de0 /plugins/vpn.c
parent3300c18821cb8fb8045c49c48a5c2386aea9a537 (diff)
downloadconnman-495bee89661d32ae27c0baa16e576c1229e20701.tar.gz
connman-495bee89661d32ae27c0baa16e576c1229e20701.tar.bz2
connman-495bee89661d32ae27c0baa16e576c1229e20701.zip
vpn: Fix fd leak
Reported by: DJ Cozatt <ygdrasil@comcast.net>
Diffstat (limited to 'plugins/vpn.c')
-rw-r--r--plugins/vpn.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/plugins/vpn.c b/plugins/vpn.c
index b75df05d..e028b63a 100644
--- a/plugins/vpn.c
+++ b/plugins/vpn.c
@@ -250,7 +250,9 @@ static int vpn_connect(struct connman_provider *provider)
}
data->if_name = (char *)g_strdup(ifr.ifr_name);
- if (!data->if_name) {
+ if (data->if_name == NULL) {
+ connman_error("Failed to allocate memory");
+ close(fd);
ret = -ENOMEM;
goto exist_err;
}