1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-09 06:21:09 +03:00

Repair bugs discussed in pghackers thread of 15 May 1999: creation of a

relcache entry no longer leaks a small amount of memory.  index_endscan
now releases all the memory acquired by index_beginscan, so callers of it
should NOT pfree the scan descriptor anymore.
This commit is contained in:
Tom Lane
1999-12-30 05:05:13 +00:00
parent 649ffe1616
commit 9c95f8c9b2
8 changed files with 61 additions and 70 deletions

View File

@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/large_object/inv_api.c,v 1.63 1999/12/16 22:19:51 wieck Exp $
* $Header: /cvsroot/pgsql/src/backend/storage/large_object/inv_api.c,v 1.64 1999/12/30 05:05:03 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -258,7 +258,6 @@ inv_close(LargeObjectDesc *obj_desc)
if (obj_desc->iscan != (IndexScanDesc) NULL)
{
index_endscan(obj_desc->iscan);
pfree(obj_desc->iscan);
obj_desc->iscan = NULL;
}
@@ -583,7 +582,6 @@ inv_cleanindex(LargeObjectDesc *obj_desc)
return;
index_endscan(obj_desc->iscan);
pfree(obj_desc->iscan);
obj_desc->iscan = (IndexScanDesc) NULL;
ItemPointerSetInvalid(&(obj_desc->htid));
@@ -1255,7 +1253,6 @@ _inv_getsize(Relation hreln, TupleDesc hdesc, Relation ireln)
if (res == (RetrieveIndexResult) NULL)
{
index_endscan(iscan);
pfree(iscan);
return 0;
}
@@ -1271,7 +1268,6 @@ _inv_getsize(Relation hreln, TupleDesc hdesc, Relation ireln)
/* don't need the index scan anymore */
index_endscan(iscan);
pfree(iscan);
/* get olastbyte attribute */
d = heap_getattr(&tuple, 1, hdesc, &isNull);