diff mbox series

[BlueZ] adapt:Set property mode failed,memory leak This patch will fix a memory leak,when set property mode,it will send a msg, but if failed,the data'memory do not free

Message ID 20200814095433.10654-1-515672508@qq.com (mailing list archive)
State Accepted
Delegated to: Luiz Von Dentz
Headers show
Series [BlueZ] adapt:Set property mode failed,memory leak This patch will fix a memory leak,when set property mode,it will send a msg, but if failed,the data'memory do not free | expand

Commit Message

chengbo Aug. 14, 2020, 9:54 a.m. UTC
---
 src/adapter.c | 1 +
 1 file changed, 1 insertion(+)

Comments

bluez.test.bot@gmail.com Aug. 14, 2020, 10:26 a.m. UTC | #1
This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
While we are preparing for reviewing the patches, we found the following
issue/warning.

Test Result:
checkgitlint Failed

Outputs:
1: T1 Title exceeds max length (161>72): "adapt:Set property mode failed,memory leak This patch will fix a memory leak,when set property mode,it will send a msg, but if failed,the data'memory do not free"
3: B6 Body message is missing



---
Regards,
Linux Bluetooth
bluez.test.bot@gmail.com Aug. 14, 2020, 10:28 a.m. UTC | #2
This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
While we are preparing for reviewing the patches, we found the following
issue/warning.

Test Result:
checkbuild Failed

Outputs:
ar: `u' modifier ignored since `D' is the default (see `U')
ar: `u' modifier ignored since `D' is the default (see `U')
ar: `u' modifier ignored since `D' is the default (see `U')
ar: `u' modifier ignored since `D' is the default (see `U')
ar: `u' modifier ignored since `D' is the default (see `U')
src/adapter.c: In function ‘property_set_mode’:
src/adapter.c:2919:2: error: this ‘if’ clause does not guard... [-Werror=misleading-indentation]
 2919 |  if (mgmt_send(adapter->mgmt, opcode, adapter->dev_id, len, param,
      |  ^~
src/adapter.c:2922:3: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
 2922 |   return;
      |   ^~~~~~
cc1: all warnings being treated as errors
make[1]: *** [Makefile:9167: src/bluetoothd-adapter.o] Error 1
make: *** [Makefile:4010: all] Error 2



---
Regards,
Linux Bluetooth
diff mbox series

Patch

diff --git a/src/adapter.c b/src/adapter.c
index 5e896a9f0..cb4cd8b75 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -2918,6 +2918,7 @@  static void property_set_mode(struct btd_adapter *adapter, uint32_t setting,
 
 	if (mgmt_send(adapter->mgmt, opcode, adapter->dev_id, len, param,
 			property_set_mode_complete, data, g_free) > 0)
+		g_free(data);
 		return;
 
 	g_free(data);