diff options
Diffstat (limited to 'src/backend/access/heap/tuptoaster.c')
-rw-r--r-- | src/backend/access/heap/tuptoaster.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/backend/access/heap/tuptoaster.c b/src/backend/access/heap/tuptoaster.c index c06b3b8d36a..02af9d8e455 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.47 2005/01/01 05:43:06 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/access/heap/tuptoaster.c,v 1.47.4.1 2006/01/17 17:33:34 tgl Exp $ * * * INTERFACE ROUTINES @@ -820,6 +820,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; @@ -866,7 +867,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 @@ -903,6 +907,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); } |