aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2005-08-25 03:53:22 +0000
committerBruce Momjian <bruce@momjian.us>2005-08-25 03:53:22 +0000
commitca4cf09232ae37c5cdaed23236dc37f37bedff55 (patch)
tree6a5bb691b76991f5a79098d4f85af1eb949f3a47 /src
parentea849a2648e720a2db31c473342ad8f5e631d825 (diff)
downloadpostgresql-ca4cf09232ae37c5cdaed23236dc37f37bedff55.tar.gz
postgresql-ca4cf09232ae37c5cdaed23236dc37f37bedff55.zip
Back out pfrees for justify_hour function calls.
Diffstat (limited to 'src')
-rw-r--r--src/backend/utils/adt/timestamp.c23
1 files changed, 10 insertions, 13 deletions
diff --git a/src/backend/utils/adt/timestamp.c b/src/backend/utils/adt/timestamp.c
index 7048b491822..c218422a797 100644
--- a/src/backend/utils/adt/timestamp.c
+++ b/src/backend/utils/adt/timestamp.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/adt/timestamp.c,v 1.149 2005/08/25 01:30:06 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/timestamp.c,v 1.150 2005/08/25 03:53:22 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1892,7 +1892,7 @@ timestamp_mi(PG_FUNCTION_ARGS)
{
Timestamp dt1 = PG_GETARG_TIMESTAMP(0);
Timestamp dt2 = PG_GETARG_TIMESTAMP(1);
- Interval *result, *result2;
+ Interval *result;
result = (Interval *) palloc(sizeof(Interval));
@@ -1914,10 +1914,9 @@ timestamp_mi(PG_FUNCTION_ARGS)
result->month = 0;
result->day = 0;
- result2 = DatumGetIntervalP(DirectFunctionCall1(interval_justify_hours,
+ result = DatumGetIntervalP(DirectFunctionCall1(interval_justify_hours,
IntervalPGetDatum(result)));
- pfree(result);
- PG_RETURN_INTERVAL_P(result2);
+ PG_RETURN_INTERVAL_P(result);
}
/* interval_justify_hours()
@@ -2264,7 +2263,7 @@ interval_mul(PG_FUNCTION_ARGS)
Interval *span = PG_GETARG_INTERVAL_P(0);
float8 factor = PG_GETARG_FLOAT8(1);
double month_remainder, day_remainder;
- Interval *result, *result2;
+ Interval *result;
result = (Interval *) palloc(sizeof(Interval));
@@ -2290,10 +2289,9 @@ interval_mul(PG_FUNCTION_ARGS)
day_remainder * SECS_PER_DAY);
#endif
- result2 = DatumGetIntervalP(DirectFunctionCall1(interval_justify_hours,
+ result = DatumGetIntervalP(DirectFunctionCall1(interval_justify_hours,
IntervalPGetDatum(result)));
- pfree(result);
- PG_RETURN_INTERVAL_P(result2);
+ PG_RETURN_INTERVAL_P(result);
}
Datum
@@ -2312,7 +2310,7 @@ interval_div(PG_FUNCTION_ARGS)
Interval *span = PG_GETARG_INTERVAL_P(0);
float8 factor = PG_GETARG_FLOAT8(1);
double month_remainder, day_remainder;
- Interval *result, *result2;
+ Interval *result;
result = (Interval *) palloc(sizeof(Interval));
@@ -2343,10 +2341,9 @@ interval_div(PG_FUNCTION_ARGS)
result->time = JROUND(result->time);
#endif
- result2 = DatumGetIntervalP(DirectFunctionCall1(interval_justify_hours,
+ result = DatumGetIntervalP(DirectFunctionCall1(interval_justify_hours,
IntervalPGetDatum(result)));
- pfree(result);
- PG_RETURN_INTERVAL_P(result2);
+ PG_RETURN_INTERVAL_P(result);
}
/*