wispr: fixing a possible memory leak if interface index cannot be retrieved
authorTomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Thu, 29 Dec 2011 11:02:21 +0000 (13:02 +0200)
committerDaniel Wagner <daniel.wagner@bmw-carit.de>
Thu, 5 Jan 2012 10:03:39 +0000 (11:03 +0100)
src/wispr.c

index 3d8bafd..84df2bc 100644 (file)
@@ -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) {