diff options
| author | Heikki Linnakangas | 2011-12-12 07:49:47 +0000 |
|---|---|---|
| committer | Heikki Linnakangas | 2011-12-12 08:10:53 +0000 |
| commit | 8409b60476a4112e654d1a5099dd67a54f197afd (patch) | |
| tree | 6451e0492f945e38a69b0517ff16ec7448aacf4d /src/include/utils/inet.h | |
| parent | 0f44335122fd01b54417bc955d6a98b967ca832c (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.h | 2 |
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)) |
