diff --git a/softap/sdk/qsap_api.c b/softap/sdk/qsap_api.c index 4bf4658..4c48cb2 100644 --- a/softap/sdk/qsap_api.c +++ b/softap/sdk/qsap_api.c @@ -1349,6 +1349,12 @@ int qsap_get_mode(s32 *pmode) //allocate socket sk = nl_socket_alloc(); + //return if socket allocation fails + if(sk == NULL){ + ALOGE( "socket allocation failure"); + return ret; + } + //connect to generic netlink if (genl_connect(sk)) { ALOGE( "Netlink socket Connection failure"); @@ -1366,6 +1372,12 @@ int qsap_get_mode(s32 *pmode) //allocate a message msg = nlmsg_alloc(); + //return if message allocation fails + if(msg == NULL){ + ALOGE( "message allocation failure"); + goto nla_put_failure; + } + // setup the message genlmsg_put(msg, 0, 0, nl80211_id, 0, 0, NL80211_CMD_GET_INTERFACE, 0);