Re: Small patch for memory leak in src/backend/catalog/pg_proc.c - Mailing list pgsql-patches

From Denis Perchine
Subject Re: Small patch for memory leak in src/backend/catalog/pg_proc.c
Date
Msg-id 00061322234001.00485@dyp
Whole thread Raw
In response to Re: Small patch for memory leak in src/backend/catalog/pg_proc.c  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Small patch for memory leak in src/backend/catalog/pg_proc.c
List pgsql-patches
>       heap_close(rel, RowExclusiveLock);
> +     heap_freetuple(tup);
>       return tup->t_data->t_oid;
>   }
>
> Uh, you didn't notice that the tuple you just freed is still in use
> on the next line?

That's right :-((( Will try to be a little bit more accurate.

> Memory leaks like this are not worth worrying about because the memory
> will be reclaimed at end of transaction --- maybe even sooner after
> I improve the memory-context handling.

But anyway it is better to free memory, because transaction can be quite large.
New patch attached.

BTW, could you please say what memory leaks can be safely ignored.

--
Sincerely Yours,
Denis Perchine

----------------------------------
E-Mail: dyp@perchine.com
HomePage: http://www.perchine.com/dyp/
FidoNet: 2:5000/120.5
----------------------------------

Attachment

pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: Small patch for memory leak in src/backend/catalog/pg_proc.c
Next
From: Denis Perchine
Date:
Subject: Re: Small patch for memory leak in src/backend/catalog/pg_proc.c