summaryrefslogtreecommitdiff
path: root/src/include/utils/inet.h
diff options
context:
space:
mode:
authorHeikki Linnakangas2011-12-12 07:49:47 +0000
committerHeikki Linnakangas2011-12-12 08:10:53 +0000
commit8409b60476a4112e654d1a5099dd67a54f197afd (patch)
tree6451e0492f945e38a69b0517ff16ec7448aacf4d /src/include/utils/inet.h
parent0f44335122fd01b54417bc955d6a98b967ca832c (diff)
Revert the behavior of inet/cidr functions to not unpack the arguments.
I forgot to change the functions to use the PG_GETARG_INET_PP() macro, when I changed DatumGetInetP() to unpack the datum, like Datum*P macros usually do. Also, I screwed up the definition of the PG_GETARG_INET_PP() macro, and didn't notice because it wasn't used. This fixes the memory leak when sorting inet values, as reported by Jochen Erwied and debugged by Andres Freund. Backpatch to 8.3, like the previous patch that broke it.
Diffstat (limited to 'src/include/utils/inet.h')
-rw-r--r--src/include/utils/inet.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/include/utils/inet.h b/src/include/utils/inet.h
index fa217b66116..bf982f67ee7 100644
--- a/src/include/utils/inet.h
+++ b/src/include/utils/inet.h
@@ -74,7 +74,7 @@ typedef struct macaddr
#define DatumGetInetPP(X) ((inet *) PG_DETOAST_DATUM_PACKED(X))
#define InetPGetDatum(X) PointerGetDatum(X)
#define PG_GETARG_INET_P(n) DatumGetInetP(PG_GETARG_DATUM(n))
-#define PG_GETARG_INET_PP(n) DatumGetInetP(PG_GETARG_DATUM_PACKED(n))
+#define PG_GETARG_INET_PP(n) DatumGetInetPP(PG_GETARG_DATUM(n))
#define PG_RETURN_INET_P(x) return InetPGetDatum(x)
/* macaddr is a fixed-length pass-by-reference datatype */
#define DatumGetMacaddrP(X) ((macaddr *) DatumGetPointer(X))