From: Daniel Wagner Date: Thu, 17 Mar 2011 13:25:38 +0000 (+0100) Subject: vpn: Fix fd leak X-Git-Tag: accepted/2.0alpha-wayland/20121110.002834~1650 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=495bee89661d32ae27c0baa16e576c1229e20701;p=profile%2Fivi%2Fconnman.git vpn: Fix fd leak Reported by: DJ Cozatt --- diff --git a/plugins/vpn.c b/plugins/vpn.c index b75df05..e028b63 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; }