summaryrefslogtreecommitdiff
path: root/src/wispr.c
diff options
context:
space:
mode:
authorTomasz Bursztyka <tomasz.bursztyka@linux.intel.com>2011-12-29 13:02:21 +0200
committerDaniel Wagner <daniel.wagner@bmw-carit.de>2012-01-05 11:03:39 +0100
commitc3fca5e6ccf799a5ced41edd29ff384c4468794c (patch)
treedb9e3e3ac309d830572fe00cf0e1bfab3882b874 /src/wispr.c
parent950569f6b46e141ccaf48d834438925ddb261baf (diff)
downloadconnman-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.c6
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) {