8
8
*
9
9
*
10
10
* 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 $
12
12
*
13
13
*-------------------------------------------------------------------------
14
14
*/
@@ -1892,7 +1892,7 @@ timestamp_mi(PG_FUNCTION_ARGS)
1892
1892
{
1893
1893
Timestamp dt1 = PG_GETARG_TIMESTAMP (0 );
1894
1894
Timestamp dt2 = PG_GETARG_TIMESTAMP (1 );
1895
- Interval * result , * result2 ;
1895
+ Interval * result ;
1896
1896
1897
1897
result = (Interval * )palloc (sizeof (Interval ));
1898
1898
@@ -1914,10 +1914,9 @@ timestamp_mi(PG_FUNCTION_ARGS)
1914
1914
result -> month = 0 ;
1915
1915
result -> day = 0 ;
1916
1916
1917
- result2 = DatumGetIntervalP (DirectFunctionCall1 (interval_justify_hours ,
1917
+ result = DatumGetIntervalP (DirectFunctionCall1 (interval_justify_hours ,
1918
1918
IntervalPGetDatum (result )));
1919
- pfree (result );
1920
- PG_RETURN_INTERVAL_P (result2 );
1919
+ PG_RETURN_INTERVAL_P (result );
1921
1920
}
1922
1921
1923
1922
/*interval_justify_hours()
@@ -2264,7 +2263,7 @@ interval_mul(PG_FUNCTION_ARGS)
2264
2263
Interval * span = PG_GETARG_INTERVAL_P (0 );
2265
2264
float8 factor = PG_GETARG_FLOAT8 (1 );
2266
2265
double month_remainder ,day_remainder ;
2267
- Interval * result , * result2 ;
2266
+ Interval * result ;
2268
2267
2269
2268
result = (Interval * )palloc (sizeof (Interval ));
2270
2269
@@ -2290,10 +2289,9 @@ interval_mul(PG_FUNCTION_ARGS)
2290
2289
day_remainder * SECS_PER_DAY );
2291
2290
#endif
2292
2291
2293
- result2 = DatumGetIntervalP (DirectFunctionCall1 (interval_justify_hours ,
2292
+ result = DatumGetIntervalP (DirectFunctionCall1 (interval_justify_hours ,
2294
2293
IntervalPGetDatum (result )));
2295
- pfree (result );
2296
- PG_RETURN_INTERVAL_P (result2 );
2294
+ PG_RETURN_INTERVAL_P (result );
2297
2295
}
2298
2296
2299
2297
Datum
@@ -2312,7 +2310,7 @@ interval_div(PG_FUNCTION_ARGS)
2312
2310
Interval * span = PG_GETARG_INTERVAL_P (0 );
2313
2311
float8 factor = PG_GETARG_FLOAT8 (1 );
2314
2312
double month_remainder ,day_remainder ;
2315
- Interval * result , * result2 ;
2313
+ Interval * result ;
2316
2314
2317
2315
result = (Interval * )palloc (sizeof (Interval ));
2318
2316
@@ -2343,10 +2341,9 @@ interval_div(PG_FUNCTION_ARGS)
2343
2341
result -> time = JROUND (result -> time );
2344
2342
#endif
2345
2343
2346
- result2 = DatumGetIntervalP (DirectFunctionCall1 (interval_justify_hours ,
2344
+ result = DatumGetIntervalP (DirectFunctionCall1 (interval_justify_hours ,
2347
2345
IntervalPGetDatum (result )));
2348
- pfree (result );
2349
- PG_RETURN_INTERVAL_P (result2 );
2346
+ PG_RETURN_INTERVAL_P (result );
2350
2347
}
2351
2348
2352
2349
/*