summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChinh Tran <chinht@quicinc.com>2010-03-31 09:46:45 -0700
committerChinh Tran <chinht@quicinc.com>2010-03-31 09:46:45 -0700
commit5204620969aa0ba2600f125b259869a147734c60 (patch)
tree9d9be242487826d499af8e61e8530b610f32c342
parenta39edfacc6cea09a53dc5feebc6b25b3867baef8 (diff)
downloadandroid_external_connectivity-5204620969aa0ba2600f125b259869a147734c60.tar.gz
android_external_connectivity-5204620969aa0ba2600f125b259869a147734c60.tar.bz2
android_external_connectivity-5204620969aa0ba2600f125b259869a147734c60.zip
external/connectivity: Fix memory leak in iproute2 command info
Free memory which is allocated for iproute2 command info Change-Id: I95f703c5a7dd3357121f23dfcbb111693f83dd51
-rwxr-xr-x[-rw-r--r--]cnd/src/cnd_process.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/cnd/src/cnd_process.cpp b/cnd/src/cnd_process.cpp
index 7d57e8f..97c75fa 100644..100755
--- a/cnd/src/cnd_process.cpp
+++ b/cnd/src/cnd_process.cpp
@@ -51,7 +51,6 @@
-
namespace android {
#define SOCKET_NAME_CND "cnd"
@@ -435,7 +434,6 @@ dispatchWlanInfo(Parcel &p, RequestInfo *pRI)
"timeStamp=%s",
args.status, args.rssi, args.ssid, args.ipAddr, args.timeStamp);
-
processCommand(pRI->pCI->commandNumber, &args, sizeof(args), pRI);
return;
@@ -461,7 +459,7 @@ dispatchWlanScanResults(Parcel &p, RequestInfo *pRI)
for (int i = 0; i < max; i++)
{
- //args->numItems = numItems;
+ args.numItems = max;
status = p.readInt32 (&t);
args.scanList[i].level = (int)t;
status = p.readInt32 (&t);
@@ -571,6 +569,15 @@ dispatchIproute2Cmd(Parcel &p, RequestInfo *pRI)
processCommand(pRI->pCI->commandNumber, &args, sizeof(args), pRI);
+ if (args.ifName != NULL) {
+ free(args.ifName);
+ }
+ if (args.ipAddr != NULL) {
+ free(args.ipAddr);
+ }
+ if (args.gatewayAddr != NULL) {
+ free(args.gatewayAddr);
+ }
return;
}