diff options
author | Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com> | 2011-12-29 13:02:21 +0200 |
---|---|---|
committer | Daniel Wagner <daniel.wagner@bmw-carit.de> | 2012-01-05 11:03:39 +0100 |
commit | c3fca5e6ccf799a5ced41edd29ff384c4468794c (patch) | |
tree | db9e3e3ac309d830572fe00cf0e1bfab3882b874 /src/wispr.c | |
parent | 950569f6b46e141ccaf48d834438925ddb261baf (diff) | |
download | connman-c3fca5e6ccf799a5ced41edd29ff384c4468794c.tar.gz connman-c3fca5e6ccf799a5ced41edd29ff384c4468794c.tar.bz2 connman-c3fca5e6ccf799a5ced41edd29ff384c4468794c.zip |
wispr: fixing a possible memory leak if interface index cannot be retrieved
Diffstat (limited to 'src/wispr.c')
-rw-r--r-- | src/wispr.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/wispr.c b/src/wispr.c index 3d8bafdb..84df2bc9 100644 --- a/src/wispr.c +++ b/src/wispr.c @@ -655,8 +655,10 @@ static int wispr_portal_detect(struct connman_wispr_portal_context *wp_context) DBG("interface %s", interface); if_index = connman_inet_ifindex(interface); - if (if_index < 0) - return -EINVAL; + if (if_index < 0) { + err = -EINVAL; + goto done; + } wp_context->web = g_web_new(if_index); if (wp_context->web == NULL) { |