mirror of
https://github.com/postgres/postgres.git
synced 2025-11-12 05:01:15 +03:00
Fix some leaks(was my fault).
This commit is contained in:
@@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.134 2001/01/18 04:01:42 inoue Exp $
|
* $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.135 2001/01/18 07:29:04 inoue Exp $
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* INTERFACE ROUTINES
|
* INTERFACE ROUTINES
|
||||||
@@ -1557,6 +1557,7 @@ setNewRelfilenode(Relation relation)
|
|||||||
memcpy((char *) &workrel, relation, sizeof(RelationData));
|
memcpy((char *) &workrel, relation, sizeof(RelationData));
|
||||||
workrel.rd_node.relNode = newrelfilenode;
|
workrel.rd_node.relNode = newrelfilenode;
|
||||||
heap_storage_create(&workrel);
|
heap_storage_create(&workrel);
|
||||||
|
smgrclose(DEFAULT_SMGR, &workrel);
|
||||||
/* update pg_class tuple with new relfilenode in place */
|
/* update pg_class tuple with new relfilenode in place */
|
||||||
if (in_place_update)
|
if (in_place_update)
|
||||||
{
|
{
|
||||||
@@ -1578,9 +1579,10 @@ setNewRelfilenode(Relation relation)
|
|||||||
idescs);
|
idescs);
|
||||||
CatalogIndexInsert(idescs, Num_pg_class_indices, pg_class, classTuple);
|
CatalogIndexInsert(idescs, Num_pg_class_indices, pg_class, classTuple);
|
||||||
CatalogCloseIndices(Num_pg_class_indices, idescs);
|
CatalogCloseIndices(Num_pg_class_indices, idescs);
|
||||||
heap_freetuple(classTuple);
|
|
||||||
}
|
}
|
||||||
heap_close(pg_class, NoLock);
|
heap_close(pg_class, NoLock);
|
||||||
|
if (!in_place_update)
|
||||||
|
heap_freetuple(classTuple);
|
||||||
/* Make sure the relfilenode change */
|
/* Make sure the relfilenode change */
|
||||||
CommandCounterIncrement();
|
CommandCounterIncrement();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user