* [PATCH] Fix mem leak in sap plugin
@ 2011-07-15 11:38 Arek Lichwa
2011-07-15 12:13 ` Luiz Augusto von Dentz
2011-07-28 7:56 ` Johan Hedberg
0 siblings, 2 replies; 4+ messages in thread
From: Arek Lichwa @ 2011-07-15 11:38 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Arek Lichwa
When dropping rfcomm channel to sap server, the component's channel
cleanup process doesn't release assigned glib channel resources.
---
sap/server.c | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/sap/server.c b/sap/server.c
index c55aa6e..8bd8fe1 100644
--- a/sap/server.c
+++ b/sap/server.c
@@ -1122,7 +1122,6 @@ static void sap_io_destroy(void *data)
conn->state == SAP_STATE_GRACEFUL_DISCONNECT)
sap_disconnect_req(NULL, 1);
- conn->io = NULL;
sap_conn_remove(conn);
}
}
--
1.7.6
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] Fix mem leak in sap plugin
2011-07-15 11:38 [PATCH] Fix mem leak in sap plugin Arek Lichwa
@ 2011-07-15 12:13 ` Luiz Augusto von Dentz
2011-07-15 12:31 ` Arkadiusz.Lichwa
2011-07-28 7:56 ` Johan Hedberg
1 sibling, 1 reply; 4+ messages in thread
From: Luiz Augusto von Dentz @ 2011-07-15 12:13 UTC (permalink / raw)
To: Arek Lichwa; +Cc: linux-bluetooth
Hi,
On Fri, Jul 15, 2011 at 2:38 PM, Arek Lichwa <arkadiusz.lichwa@tieto.com> wrote:
> When dropping rfcomm channel to sap server, the component's channel
> cleanup process doesn't release assigned glib channel resources.
> ---
> sap/server.c | 1 -
> 1 files changed, 0 insertions(+), 1 deletions(-)
>
> diff --git a/sap/server.c b/sap/server.c
> index c55aa6e..8bd8fe1 100644
> --- a/sap/server.c
> +++ b/sap/server.c
> @@ -1122,7 +1122,6 @@ static void sap_io_destroy(void *data)
> conn->state == SAP_STATE_GRACEFUL_DISCONNECT)
> sap_disconnect_req(NULL, 1);
>
> - conn->io = NULL;
> sap_conn_remove(conn);
> }
> }
> --
> 1.7.6
It doesn't seems this release any memory, maybe the problem is not a
memory leak but an invalid access to freed memory?
--
Luiz Augusto von Dentz
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: [PATCH] Fix mem leak in sap plugin
2011-07-15 12:13 ` Luiz Augusto von Dentz
@ 2011-07-15 12:31 ` Arkadiusz.Lichwa
0 siblings, 0 replies; 4+ messages in thread
From: Arkadiusz.Lichwa @ 2011-07-15 12:31 UTC (permalink / raw)
To: luiz.dentz; +Cc: linux-bluetooth
Hi Luiz
>Hi,
>
>On Fri, Jul 15, 2011 at 2:38 PM, Arek Lichwa <arkadiusz.lichwa@tieto.com>
>wrote:
>> When dropping rfcomm channel to sap server, the component's channel
>> cleanup process doesn't release assigned glib channel resources.
>> ---
>> sap/server.c | 1 -
>> 1 files changed, 0 insertions(+), 1 deletions(-)
>>
>> diff --git a/sap/server.c b/sap/server.c
>> index c55aa6e..8bd8fe1 100644
>> --- a/sap/server.c
>> +++ b/sap/server.c
>> @@ -1122,7 +1122,6 @@ static void sap_io_destroy(void *data)
>> conn->state ==
>SAP_STATE_GRACEFUL_DISCONNECT)
>> sap_disconnect_req(NULL, 1);
>>
>> - conn->io = NULL;
>> sap_conn_remove(conn);
>> }
>> }
>> --
>> 1.7.6
>
>It doesn't seems this release any memory, maybe the problem is not a
>memory leak but an invalid access to freed memory?
Actually the realese/cleanup process of glib resource isn't triggered.
It would when last reference to conn->io get 0. It's been triggered in
sap_conn_remove() but conn->io already got null before that.
So it needs better description ?
/Arek
>
>--
>Luiz Augusto von Dentz
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Fix mem leak in sap plugin
2011-07-15 11:38 [PATCH] Fix mem leak in sap plugin Arek Lichwa
2011-07-15 12:13 ` Luiz Augusto von Dentz
@ 2011-07-28 7:56 ` Johan Hedberg
1 sibling, 0 replies; 4+ messages in thread
From: Johan Hedberg @ 2011-07-28 7:56 UTC (permalink / raw)
To: Arek Lichwa; +Cc: linux-bluetooth
Hi Arek,
On Fri, Jul 15, 2011, Arek Lichwa wrote:
> When dropping rfcomm channel to sap server, the component's channel
> cleanup process doesn't release assigned glib channel resources.
> ---
> sap/server.c | 1 -
> 1 files changed, 0 insertions(+), 1 deletions(-)
Applied. I had to actually look at the code to determine that the patch
is correct since your commit message doesn't really explain the
situation clearly enough (which is also why you got initial doubts from
Luiz).
Johan
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-07-28 7:56 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-15 11:38 [PATCH] Fix mem leak in sap plugin Arek Lichwa
2011-07-15 12:13 ` Luiz Augusto von Dentz
2011-07-15 12:31 ` Arkadiusz.Lichwa
2011-07-28 7:56 ` Johan Hedberg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).