Fix memory leak in __netconfig_request_netlink_scan()
[platform/core/connectivity/net-config.git] / src / wifi-netlink-scan.c
index e008fd2..3ad72c5 100755 (executable)
@@ -693,7 +693,7 @@ static int __netconfig_request_netlink_scan(struct nl_sock *socket,
 
        if (results.aborted) {
                DBG("scan aborted");
-               return 1;
+               goto out;
        }
 
 out:
@@ -703,7 +703,7 @@ out:
        nl_cb_put(cb);
        nl_socket_drop_membership(socket, mcid);
 
-       if (ret < 0)
+       if (ret < 0 || ret == 1)
                return ret;
 
        DBG("Scan done");