aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/rtree/rtproc.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2000-12-08 23:57:03 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2000-12-08 23:57:03 +0000
commit376784cf8ac7dee831471d7fd4159145d135636b (patch)
tree62008e893458d778777a871f672c5545d5c9b241 /src/backend/access/rtree/rtproc.c
parentfb47385fc8d2314dd7d23d691959c882ead1c31a (diff)
downloadpostgresql-376784cf8ac7dee831471d7fd4159145d135636b.tar.gz
postgresql-376784cf8ac7dee831471d7fd4159145d135636b.zip
Repair erroneous use of hashvarlena() for MACADDR, which is not a
varlena type. (I did not force initdb, but you won't see the fix unless you do one.) Also, make sure all index support operators and functions are careful not to leak memory for toasted inputs; I had missed some hash and rtree support ops on this point before.
Diffstat (limited to 'src/backend/access/rtree/rtproc.c')
-rw-r--r--src/backend/access/rtree/rtproc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/backend/access/rtree/rtproc.c b/src/backend/access/rtree/rtproc.c
index dfe5805a6b0..6ee95fbc445 100644
--- a/src/backend/access/rtree/rtproc.c
+++ b/src/backend/access/rtree/rtproc.c
@@ -15,7 +15,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtproc.c,v 1.29 2000/07/30 20:43:40 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtproc.c,v 1.30 2000/12/08 23:57:01 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -183,5 +183,8 @@ rt_poly_size(PG_FUNCTION_ARGS)
*size = (float) (xdim * ydim);
}
+ /* Avoid leaking memory when handed toasted input. */
+ PG_FREE_IF_COPY(a, 0);
+
PG_RETURN_VOID();
}