Re: [patch] fix error freeing case



On Fri, 2004-08-13 at 15:25 -0400, Jody Goldberg wrote:
> On Fri, Jul 30, 2004 at 01:29:56PM -0400, Colin Walters wrote:
> > Hi,
> > 
> > This little patch should avoid possibly double-freeing a GError.
> 
> > diff -u /src/work/rpms/libgnomecups/libgnomecups-0.1.9/libgnomecups/gnome-cups-request.c /tmp/buffer-content-19353QJP
> > --- libgnomecups-0.1.9/libgnomecups/gnome-cups-request.c~	2004-07-29 13:53:18.862915872 -0400
> > +++ libgnomecups-0.1.9/libgnomecups/gnome-cups-request.c	2004-07-29 13:53:29.574287496 -0400
> > @@ -265,8 +266,6 @@
> >  gnome_cups_request_struct_free (GnomeCupsRequest *request)
> >  {
> >  	g_free (request->path);
> > -	if (request->error && *request->error)
> > -		g_error_free (*request->error);
> >  	g_free (request);
> >  }	
> 
> This looks like the right thing, but The memory life cycle for these
> requests is less than crystal clear. 

Yeah, it is a bit tricky.

>  Could you throw in some
> comments on which parts of the request should be freed by the hander
> and which we handle ?

Ok, done.

Attachment: signature.asc
Description: This is a digitally signed message part



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]