[Spice-devel] [spice-server v3 5/8] reds: Close sockets when using spice_server_destroy()

Christophe Fergeau cfergeau at redhat.com
Wed Feb 8 10:43:19 UTC 2017


On Wed, Feb 08, 2017 at 10:50:52AM +0100, Pavel Grunt wrote:
> On Mon, 2017-02-06 at 18:15 +0100, Christophe Fergeau wrote:
> > Currently, the network sockets opened by reds_init_net() are not
> > closed
> > on destruction, in other words they are leaked.
> 
> Acked-by: Pavel Grunt <pgrunt at redhat.com>
> 
> > ---
> >  server/reds.c | 13 +++++++++++++
> >  1 file changed, 13 insertions(+)
> > 
> > diff --git a/server/reds.c b/server/reds.c
> > index 953a95a..ff0f0e2 100644
> > --- a/server/reds.c
> > +++ b/server/reds.c
> > @@ -3472,6 +3472,9 @@ SPICE_GNUC_VISIBLE SpiceServer
> > *spice_server_new(void)
> >  #ifdef RED_STATISTICS
> >      reds->stat_file = stat_file_new(REDS_MAX_STAT_NODES);
> >  #endif
> > +    reds->listen_socket = -1;
> > +    reds->secure_listen_socket = -1;
> > +
> 
> so this init can be removed from do_spice_init

Ah, I missed it, thanks. Is it valid to call spice_server_init() twice
on the same SpiceServer instance to "reset" it? I guess not, but thought
I'd ask :)

Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20170208/03f33d16/attachment.sig>


More information about the Spice-devel mailing list