summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiranjan Pendharkar <npendhar@codeaurora.org>2017-09-25 09:00:24 -0700
committerErik Kline <ek@google.com>2017-09-29 16:56:57 +0900
commit67b2d096ba112493dff7a127e702f1e38e0c4794 (patch)
treeb0f0fce16acc1d7e54faeb786441a6ae8c1c4eb0
parent05ca4a42d80e106de2e227fac16d4c264ac8eb40 (diff)
downloadipacfg-mgr-67b2d096ba112493dff7a127e702f1e38e0c4794.tar.gz
IPACM: fix the fd leaking issue
Fix the fd leaking issue on "resetTetherStats" and "getStats" APIs. Test: Manual Bug: 29337859 Bug: 32163131 Bug: 64976634 Bug: 65612126 Change-Id: I131c6ebe1ea1e14194fe4fe019eb21364032e154 Signed-off-by: Skylar Chang <chiaweic@codeaurora.org> Signed-off-by: Niranjan Pendharkar <npendhar@codeaurora.org> (cherry picked from commit 42959c94d518dd6c5424040b0310dbb23d9dc158)
-rw-r--r--msm8998/ipacm/src/IPACM_OffloadManager.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/msm8998/ipacm/src/IPACM_OffloadManager.cpp b/msm8998/ipacm/src/IPACM_OffloadManager.cpp
index bc88024..ca54ea6 100644
--- a/msm8998/ipacm/src/IPACM_OffloadManager.cpp
+++ b/msm8998/ipacm/src/IPACM_OffloadManager.cpp
@@ -564,6 +564,7 @@ RET IPACM_OffloadManager::getStats(const char * upstream_name /* upstream */,
offload_stats.rx = stats.rx_bytes;
IPACMDBG_H("send getStats tx:%lu rx:%lu \n", offload_stats.tx, offload_stats.rx);
+ close(fd);
return SUCCESS;
}
@@ -664,6 +665,7 @@ int IPACM_OffloadManager::resetTetherStats(const char * upstream_name /* upstrea
return FAIL_HARDWARE;
}
IPACMDBG_H("Reset Interface %s stats\n", upstream_name);
+ close(fd);
return IPACM_SUCCESS;
}