- negative_returns: "g_monitor_sockfd" is passed to a parameter that cannot be negative
- resource leak : all the sockets created in wfd_ws_activate() should be closed in case of failure
Change-Id: I28f26b714b6aba61c3b84b78361ea11557a818ec
+wfi-direct-manager (0.6.7) precise; urgency=low
+
+ * Remove prevent issue : Improper use of negative value
+ * Git : framework/connectivity/wifi-direct-manager
+ * Tag : wifi-direct-manager_0.6.7
+
+ -- Jaehyun Kim <jeik01@samsung.com> Sun, 03 Feb 2013 23:16:38 +0900
+
wfi-direct-manager (0.6.6) precise; urgency=low
* Fix resource leaks
wfi-direct-manager (0.6.6) precise; urgency=low
* Fix resource leaks
Name: wifi-direct-manager
Summary: Wi-Fi Direct manger
Name: wifi-direct-manager
Summary: Wi-Fi Direct manger
Release: 1
Group: TO_BE_FILLED
License: Apache License Version 2.0
Release: 1
Group: TO_BE_FILLED
License: Apache License Version 2.0
char cmd[128] = {0, };
char res_buffer[1024]={0,};
int res_buffer_len=sizeof(res_buffer);
char cmd[128] = {0, };
char res_buffer[1024]={0,};
int res_buffer_len=sizeof(res_buffer);
// Loading Driver, Excuting p2p_supplicant
system("/usr/bin/wlan.sh p2p");
system("/usr/sbin/p2p_supp.sh start");
// Loading Driver, Excuting p2p_supplicant
system("/usr/bin/wlan.sh p2p");
system("/usr/sbin/p2p_supp.sh start");
if (__wpa_ctrl_attach(g_monitor_sockfd) < 0)
{
WDP_LOGE( "Failed to attach monitor socket! sockfd=[%d]", g_monitor_sockfd);
if (__wpa_ctrl_attach(g_monitor_sockfd) < 0)
{
WDP_LOGE( "Failed to attach monitor socket! sockfd=[%d]", g_monitor_sockfd);
+ system("/usr/sbin/p2p_supp.sh stop");
+ system("/usr/bin/wlan.sh stop");
+ close(g_global_sockfd);
+ close(g_control_sockfd);
+ close(g_monitor_sockfd);
+ } else
+ close(g_control_sockfd);
} else {
WDP_LOGE( "Failed to attach control socket! sockfd=[%d]", g_control_sockfd);
}
count--;
} else {
WDP_LOGE( "Failed to attach control socket! sockfd=[%d]", g_control_sockfd);
}
count--;
- if (count == 0)
- WDP_LOGE( "Failed to create socket !!\n");
-
+ if (count == 0) {
+ WDP_LOGE( "Failed to create socket !!\n");
+ system("/usr/sbin/p2p_supp.sh stop");
+ system("/usr/bin/wlan.sh stop");
+ close(g_global_sockfd);
+ return false;
+ }
+
} while (count > 0);
WDP_LOGD( "Successfully socket connected to server !!\n");
} while (count > 0);
WDP_LOGD( "Successfully socket connected to server !!\n");