[Spice-devel,1/2] free main channel on shutdown

Submitted by Christophe Fergeau on Aug. 10, 2011, 12:09 a.m.

Details

Message ID 1312909778-26615-1-git-send-email-cfergeau@redhat.com
State New, archived
Headers show

Not browsing as part of any series.

Commit Message

Christophe Fergeau Aug. 10, 2011, 12:09 a.m.
If we don't free it, we'll leak the memory that was allocated in
main_channel_init().
---
 server/main_channel.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

Patch hide | download patch | download mbox

diff --git a/server/main_channel.c b/server/main_channel.c
index 1a6a89c..460c21b 100644
--- a/server/main_channel.c
+++ b/server/main_channel.c
@@ -860,6 +860,7 @@  static void main_channel_shutdown(Channel *channel)
     if (main_chan != NULL) {
         main_disconnect(main_chan);
     }
+    free(channel);
 }
 
 static void main_channel_migrate()

Comments

Ping?

Christophe

On Tue, Aug 09, 2011 at 07:09:37PM +0200, Christophe Fergeau wrote:
> If we don't free it, we'll leak the memory that was allocated in
> main_channel_init().
> ---
>  server/main_channel.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/server/main_channel.c b/server/main_channel.c
> index 1a6a89c..460c21b 100644
> --- a/server/main_channel.c
> +++ b/server/main_channel.c
> @@ -860,6 +860,7 @@ static void main_channel_shutdown(Channel *channel)
>      if (main_chan != NULL) {
>          main_disconnect(main_chan);
>      }
> +    free(channel);
>  }
>  
>  static void main_channel_migrate()
> -- 
> 1.7.6
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel
Ack.

On 08/17/2011 03:20 AM, Christophe Fergeau wrote:
> Ping?
>
> Christophe
>
> On Tue, Aug 09, 2011 at 07:09:37PM +0200, Christophe Fergeau wrote:
>> If we don't free it, we'll leak the memory that was allocated in
>> main_channel_init().
>> ---
>>   server/main_channel.c |    1 +
>>   1 files changed, 1 insertions(+), 0 deletions(-)
>>
>> diff --git a/server/main_channel.c b/server/main_channel.c
>> index 1a6a89c..460c21b 100644
>> --- a/server/main_channel.c
>> +++ b/server/main_channel.c
>> @@ -860,6 +860,7 @@ static void main_channel_shutdown(Channel *channel)
>>       if (main_chan != NULL) {
>>           main_disconnect(main_chan);
>>       }
>> +    free(channel);
>>   }
>>
>>   static void main_channel_migrate()
>> --
>> 1.7.6
>>
>> _______________________________________________
>> Spice-devel mailing list
>> Spice-devel@lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/spice-devel
>>
>>
>> _______________________________________________
>> Spice-devel mailing list
>> Spice-devel@lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/spice-devel
On Wed, Aug 17, 2011 at 12:20:11PM +0200, Christophe Fergeau wrote:
> Ping?
> 

I'm going to be pushing the multiclient patches, including Yonit's changes
that kill the Channel struct and reuse RedChannel for that, Any Day Now, I
so this will be redundant. (and maybe you'll find a new leak afterwards :/ )

> Christophe
> 
> On Tue, Aug 09, 2011 at 07:09:37PM +0200, Christophe Fergeau wrote:
> > If we don't free it, we'll leak the memory that was allocated in
> > main_channel_init().
> > ---
> >  server/main_channel.c |    1 +
> >  1 files changed, 1 insertions(+), 0 deletions(-)
> > 
> > diff --git a/server/main_channel.c b/server/main_channel.c
> > index 1a6a89c..460c21b 100644
> > --- a/server/main_channel.c
> > +++ b/server/main_channel.c
> > @@ -860,6 +860,7 @@ static void main_channel_shutdown(Channel *channel)
> >      if (main_chan != NULL) {
> >          main_disconnect(main_chan);
> >      }
> > +    free(channel);
> >  }
> >  
> >  static void main_channel_migrate()
> > -- 
> > 1.7.6
> > 
> > _______________________________________________
> > Spice-devel mailing list
> > Spice-devel@lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/spice-devel



> _______________________________________________
> Spice-devel mailing list
> Spice-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel
On Wed, Aug 17, 2011 at 10:55:53AM -0700, Alon Levy wrote:
> On Wed, Aug 17, 2011 at 12:20:11PM +0200, Christophe Fergeau wrote:
> > Ping?
> > 
> 
> I'm going to be pushing the multiclient patches, including Yonit's changes
> that kill the Channel struct and reuse RedChannel for that, Any Day Now, I
> so this will be redundant. (and maybe you'll find a new leak afterwards :/ )
> 

Just to be clear (I reversed this request in an email to another patch, not a good
practice), Ack by me too.

> > Christophe
> > 
> > On Tue, Aug 09, 2011 at 07:09:37PM +0200, Christophe Fergeau wrote:
> > > If we don't free it, we'll leak the memory that was allocated in
> > > main_channel_init().
> > > ---
> > >  server/main_channel.c |    1 +
> > >  1 files changed, 1 insertions(+), 0 deletions(-)
> > > 
> > > diff --git a/server/main_channel.c b/server/main_channel.c
> > > index 1a6a89c..460c21b 100644
> > > --- a/server/main_channel.c
> > > +++ b/server/main_channel.c
> > > @@ -860,6 +860,7 @@ static void main_channel_shutdown(Channel *channel)
> > >      if (main_chan != NULL) {
> > >          main_disconnect(main_chan);
> > >      }
> > > +    free(channel);
> > >  }
> > >  
> > >  static void main_channel_migrate()
> > > -- 
> > > 1.7.6
> > > 
> > > _______________________________________________
> > > Spice-devel mailing list
> > > Spice-devel@lists.freedesktop.org
> > > http://lists.freedesktop.org/mailman/listinfo/spice-devel
> 
> 
> 
> > _______________________________________________
> > Spice-devel mailing list
> > Spice-devel@lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/spice-devel
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel