* [PATCH BlueZ v1] health/mcap: fix memory leak in mcap_create_mcl()
@ 2024-06-27 13:32 Roman Smirnov
2024-06-27 15:37 ` [BlueZ,v1] " bluez.test.bot
2024-06-27 18:40 ` [PATCH BlueZ v1] " patchwork-bot+bluetooth
0 siblings, 2 replies; 3+ messages in thread
From: Roman Smirnov @ 2024-06-27 13:32 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Roman Smirnov
set_default_cb() can allocate memory for mcl->cb but it does
not free mcl->cb before exiting the function.
Add freeing mcl->cb before exiting the function.
Found by Linux Verification Center (linuxtesting.org) with the SVACE
static analysis tool.
---
profiles/health/mcap.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/profiles/health/mcap.c b/profiles/health/mcap.c
index 5d2bac3d9..b544b9a0a 100644
--- a/profiles/health/mcap.c
+++ b/profiles/health/mcap.c
@@ -1907,6 +1907,7 @@ gboolean mcap_create_mcl(struct mcap_instance *mi,
set_default_cb(mcl);
if (util_getrandom(&val, sizeof(val), 0) < 0) {
mcap_instance_unref(mcl->mi);
+ g_free(mcl->cb);
g_free(mcl);
return FALSE;
}
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* RE: [BlueZ,v1] health/mcap: fix memory leak in mcap_create_mcl()
2024-06-27 13:32 [PATCH BlueZ v1] health/mcap: fix memory leak in mcap_create_mcl() Roman Smirnov
@ 2024-06-27 15:37 ` bluez.test.bot
2024-06-27 18:40 ` [PATCH BlueZ v1] " patchwork-bot+bluetooth
1 sibling, 0 replies; 3+ messages in thread
From: bluez.test.bot @ 2024-06-27 15:37 UTC (permalink / raw)
To: linux-bluetooth, r.smirnov
[-- Attachment #1: Type: text/plain, Size: 948 bytes --]
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.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=866166
---Test result---
Test Summary:
CheckPatch PASS 0.44 seconds
GitLint PASS 0.47 seconds
BuildEll PASS 24.40 seconds
BluezMake PASS 1627.52 seconds
MakeCheck PASS 13.50 seconds
MakeDistcheck PASS 176.38 seconds
CheckValgrind PASS 251.58 seconds
CheckSmatch PASS 352.26 seconds
bluezmakeextell PASS 119.01 seconds
IncrementalBuild PASS 1385.19 seconds
ScanBuild PASS 994.03 seconds
---
Regards,
Linux Bluetooth
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH BlueZ v1] health/mcap: fix memory leak in mcap_create_mcl()
2024-06-27 13:32 [PATCH BlueZ v1] health/mcap: fix memory leak in mcap_create_mcl() Roman Smirnov
2024-06-27 15:37 ` [BlueZ,v1] " bluez.test.bot
@ 2024-06-27 18:40 ` patchwork-bot+bluetooth
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+bluetooth @ 2024-06-27 18:40 UTC (permalink / raw)
To: Roman Smirnov; +Cc: linux-bluetooth
Hello:
This patch was applied to bluetooth/bluez.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:
On Thu, 27 Jun 2024 16:32:21 +0300 you wrote:
> set_default_cb() can allocate memory for mcl->cb but it does
> not free mcl->cb before exiting the function.
>
> Add freeing mcl->cb before exiting the function.
>
> Found by Linux Verification Center (linuxtesting.org) with the SVACE
> static analysis tool.
>
> [...]
Here is the summary with links:
- [BlueZ,v1] health/mcap: fix memory leak in mcap_create_mcl()
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=2ebb415b12c4
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-06-27 18:40 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-27 13:32 [PATCH BlueZ v1] health/mcap: fix memory leak in mcap_create_mcl() Roman Smirnov
2024-06-27 15:37 ` [BlueZ,v1] " bluez.test.bot
2024-06-27 18:40 ` [PATCH BlueZ v1] " patchwork-bot+bluetooth
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox