Re: [patch] fix error freeing case
Jody Goldberg <[email protected]> Fri, 13 Aug 2004 15:25:10 -0400
| Newsgroups | gmane.comp.gnome.print |
|---|---|
| Message-ID | <[email protected]> |
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. Could you throw in some
comments on which parts of the request should be freed by the hander
and which we handle ?