Re: [patch] fix error freeing case

Colin Walters <[email protected]> Fri, 13 Aug 2004 17:19:01 -0400
Newsgroups gmane.comp.gnome.print
Message-ID <[email protected]>
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.

_______________________________________________
gnome-print-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/gnome-print-list
signature.asc (application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)

iD8DBQBBHTBFOIkJWWp2WGURAvtwAJ4/p8z3jZ8VJ72k+L7R0PHApBzFGQCff64k
hM8b3MLzjK/CsSRpGe11qYA=
=kja8
-----END PGP SIGNATURE-----