summaryrefslogtreecommitdiffstats
path: root/bcmdhd
diff options
context:
space:
mode:
authorVinit Deshpande <vinitd@google.com>2015-12-11 13:44:59 -0800
committerThierry Strudel <tstrudel@google.com>2015-12-14 22:25:18 +0000
commit3a30c034a9f319692c2ba131906e009eaa254817 (patch)
tree2daf13f10c70dc7413deeff50a2cb2c3a3d3d8e2 /bcmdhd
parent5585f1fb701b327ccfbb995610f2ae5657f390c8 (diff)
downloadhardware_broadcom_wlan-3a30c034a9f319692c2ba131906e009eaa254817.zip
hardware_broadcom_wlan-3a30c034a9f319692c2ba131906e009eaa254817.tar.gz
hardware_broadcom_wlan-3a30c034a9f319692c2ba131906e009eaa254817.tar.bz2
Fix a potential leak of nl_msg objects
It was discovered on other repos that a leak can be caused by repeated usage of create(). Bug: 26116598 Change-Id: Ie6cd318171e58d3ffa1a6c8f58cfa38ea7d78b00
Diffstat (limited to 'bcmdhd')
-rw-r--r--bcmdhd/wifi_hal/cpp_bindings.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/bcmdhd/wifi_hal/cpp_bindings.cpp b/bcmdhd/wifi_hal/cpp_bindings.cpp
index 5b085d8..399199d 100644
--- a/bcmdhd/wifi_hal/cpp_bindings.cpp
+++ b/bcmdhd/wifi_hal/cpp_bindings.cpp
@@ -538,6 +538,9 @@ int WifiEvent::parse() {
}
int WifiRequest::create(int family, uint8_t cmd, int flags, int hdrlen) {
+
+ destroy();
+
mMsg = nlmsg_alloc();
if (mMsg != NULL) {
genlmsg_put(mMsg, /* pid = */ 0, /* seq = */ 0, family,