aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/heap/tuptoaster.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/access/heap/tuptoaster.c')
-rw-r--r--src/backend/access/heap/tuptoaster.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/backend/access/heap/tuptoaster.c b/src/backend/access/heap/tuptoaster.c
index 2292f696512..bdd9bc100ac 100644
--- a/src/backend/access/heap/tuptoaster.c
+++ b/src/backend/access/heap/tuptoaster.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/access/heap/tuptoaster.c,v 1.53.2.2 2005/11/22 18:23:04 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/access/heap/tuptoaster.c,v 1.53.2.3 2006/01/17 17:33:20 tgl Exp $
*
*
* INTERFACE ROUTINES
@@ -847,6 +847,7 @@ toast_flatten_tuple_attribute(Datum value,
if (tupleDesc == NULL)
return value; /* not a composite type */
+ tupleDesc = CreateTupleDescCopy(tupleDesc);
att = tupleDesc->attrs;
numAttrs = tupleDesc->natts;
@@ -893,7 +894,10 @@ toast_flatten_tuple_attribute(Datum value,
* If nothing to untoast, just return the original tuple.
*/
if (!need_change)
+ {
+ FreeTupleDesc(tupleDesc);
return value;
+ }
/*
* Calculate the new size of the tuple. Header size should not change,
@@ -930,6 +934,7 @@ toast_flatten_tuple_attribute(Datum value,
for (i = 0; i < numAttrs; i++)
if (toast_free[i])
pfree(DatumGetPointer(toast_values[i]));
+ FreeTupleDesc(tupleDesc);
return PointerGetDatum(new_data);
}