88 *
99 *
1010 * IDENTIFICATION
11- * $PostgreSQL: pgsql/src/backend/utils/adt/timestamp.c,v 1.149 2005/08/2501:30:06 momjian Exp $
11+ * $PostgreSQL: pgsql/src/backend/utils/adt/timestamp.c,v 1.150 2005/08/2503:53:22 momjian Exp $
1212 *
1313 *-------------------------------------------------------------------------
1414 */
@@ -1892,7 +1892,7 @@ timestamp_mi(PG_FUNCTION_ARGS)
18921892{
18931893Timestamp dt1 = PG_GETARG_TIMESTAMP (0 );
18941894Timestamp dt2 = PG_GETARG_TIMESTAMP (1 );
1895- Interval * result , * result2 ;
1895+ Interval * result ;
18961896
18971897result = (Interval * )palloc (sizeof (Interval ));
18981898
@@ -1914,10 +1914,9 @@ timestamp_mi(PG_FUNCTION_ARGS)
19141914result -> month = 0 ;
19151915result -> day = 0 ;
19161916
1917- result2 = DatumGetIntervalP (DirectFunctionCall1 (interval_justify_hours ,
1917+ result = DatumGetIntervalP (DirectFunctionCall1 (interval_justify_hours ,
19181918IntervalPGetDatum (result )));
1919- pfree (result );
1920- PG_RETURN_INTERVAL_P (result2 );
1919+ PG_RETURN_INTERVAL_P (result );
19211920}
19221921
19231922/*interval_justify_hours()
@@ -2264,7 +2263,7 @@ interval_mul(PG_FUNCTION_ARGS)
22642263Interval * span = PG_GETARG_INTERVAL_P (0 );
22652264float8 factor = PG_GETARG_FLOAT8 (1 );
22662265double month_remainder ,day_remainder ;
2267- Interval * result , * result2 ;
2266+ Interval * result ;
22682267
22692268result = (Interval * )palloc (sizeof (Interval ));
22702269
@@ -2290,10 +2289,9 @@ interval_mul(PG_FUNCTION_ARGS)
22902289day_remainder * SECS_PER_DAY );
22912290#endif
22922291
2293- result2 = DatumGetIntervalP (DirectFunctionCall1 (interval_justify_hours ,
2292+ result = DatumGetIntervalP (DirectFunctionCall1 (interval_justify_hours ,
22942293IntervalPGetDatum (result )));
2295- pfree (result );
2296- PG_RETURN_INTERVAL_P (result2 );
2294+ PG_RETURN_INTERVAL_P (result );
22972295}
22982296
22992297Datum
@@ -2312,7 +2310,7 @@ interval_div(PG_FUNCTION_ARGS)
23122310Interval * span = PG_GETARG_INTERVAL_P (0 );
23132311float8 factor = PG_GETARG_FLOAT8 (1 );
23142312double month_remainder ,day_remainder ;
2315- Interval * result , * result2 ;
2313+ Interval * result ;
23162314
23172315result = (Interval * )palloc (sizeof (Interval ));
23182316
@@ -2343,10 +2341,9 @@ interval_div(PG_FUNCTION_ARGS)
23432341result -> time = JROUND (result -> time );
23442342#endif
23452343
2346- result2 = DatumGetIntervalP (DirectFunctionCall1 (interval_justify_hours ,
2344+ result = DatumGetIntervalP (DirectFunctionCall1 (interval_justify_hours ,
23472345IntervalPGetDatum (result )));
2348- pfree (result );
2349- PG_RETURN_INTERVAL_P (result2 );
2346+ PG_RETURN_INTERVAL_P (result );
23502347}
23512348
23522349/*