gdbus: fix double free
PATCH 1/1 gdbus: fix double free
Hey Connman Maintainers,
I'd like to submit a patch to avoid potential memory corruption in connman. I've attached it for review, please let me know what you think!
-Colin
PATCH 1/1 gdbus: fix double free
These are freed later in filter_data_free.
--- gdbus/watch.c | 1 - 1 file changed, 1 deletion(-)
gdbus/watch.c +0 -1
@@ -332,7 +332,6 @@ static void filter_data_call_and_free(struct filter_data *data) cb->disc_func (data->connection, cb->user_data);if (cb->destroy_func) cb->destroy_func (cb->user_data); -g_free (cb); }filter_data_free (data);
Signature · 1 line
2.49.0
Hi Colin,
+1 for this, it was also found by Clang analyzer, I forgot to push my finding on this here https://github.com/sailfishos/connman/commit/6aa2c2910edc2186233da64726d4afa0c17aa5b3
Cheers,
Jussi
Quoted 19 lines · Colin Wee
These are freed later in
filter_data_free.Signed-off-by Colin Wee <[email protected]>--- gdbus/watch.c | 1 - 1 file changed, 1 deletion(-)gdbus/watch.c +0
-1@@ -332,7 +332,6 @@ static void filter_data_call_and_free(struct filter_data *data) cb->disc_func (data->connection, cb->user_data);if (cb->destroy_func) cb->destroy_func (cb->user_data); -g_free (cb); }filter_data_free (data);
Nice, Jussi! Glad we arrived at the same fix :)
-Colin
Quoted 28 lines · Jussi Laakkonen
Hi Colin,
+1 for this, it was also found by Clang analyzer, I forgot to push my
finding on this here https://github.com/sailfishos/connman/commit/6aa2c2910edc2186233da64726d4afa0c17aa5b3Cheers,
JussiQuoted 18 lines · Colin Wee
These are freed later in
filter_data_free.Signed-off-by Colin Wee <[email protected]>--- gdbus/watch.c | 1 - 1 file changed, 1 deletion(-)gdbus/watch.c +0
-1@@ -332,7 +332,6 @@ static void filter_data_call_and_free(struct filter_data *data) cb->disc_func (data->connection, cb->user_data);if (cb->destroy_func) cb->destroy_func (cb->user_data); -g_free (cb); }filter_data_free (data);
This patch was applied to connman.git (master) by Denis Kenzior <[email protected]>:
Hello:
This patch was applied to connman.git (master)
by Denis Kenzior <[email protected]>:
Quoted 6 lines · On Sat, 5 Apr 2025 02:09:55 +0000 you wrote:
These are freed later in
filter_data_free.Signed-off-by Colin Wee <[email protected]>--- gdbus/watch.c | 1 - 1 file changed, 1 deletion(-)
Here is the summary with links:
- gdbus: fix double free
https://git.kernel.org/pub/scm/network/connman/connman.git/?id=96dbccb35e00
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html