Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitca4cf09

Browse files
committed
Back out pfrees for justify_hour function calls.
1 parentea849a2 commitca4cf09

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

‎src/backend/utils/adt/timestamp.c

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
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
{
18931893
Timestampdt1=PG_GETARG_TIMESTAMP(0);
18941894
Timestampdt2=PG_GETARG_TIMESTAMP(1);
1895-
Interval*result,*result2;
1895+
Interval*result;
18961896

18971897
result= (Interval*)palloc(sizeof(Interval));
18981898

@@ -1914,10 +1914,9 @@ timestamp_mi(PG_FUNCTION_ARGS)
19141914
result->month=0;
19151915
result->day=0;
19161916

1917-
result2=DatumGetIntervalP(DirectFunctionCall1(interval_justify_hours,
1917+
result=DatumGetIntervalP(DirectFunctionCall1(interval_justify_hours,
19181918
IntervalPGetDatum(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)
22642263
Interval*span=PG_GETARG_INTERVAL_P(0);
22652264
float8factor=PG_GETARG_FLOAT8(1);
22662265
doublemonth_remainder,day_remainder;
2267-
Interval*result,*result2;
2266+
Interval*result;
22682267

22692268
result= (Interval*)palloc(sizeof(Interval));
22702269

@@ -2290,10 +2289,9 @@ interval_mul(PG_FUNCTION_ARGS)
22902289
day_remainder*SECS_PER_DAY);
22912290
#endif
22922291

2293-
result2=DatumGetIntervalP(DirectFunctionCall1(interval_justify_hours,
2292+
result=DatumGetIntervalP(DirectFunctionCall1(interval_justify_hours,
22942293
IntervalPGetDatum(result)));
2295-
pfree(result);
2296-
PG_RETURN_INTERVAL_P(result2);
2294+
PG_RETURN_INTERVAL_P(result);
22972295
}
22982296

22992297
Datum
@@ -2312,7 +2310,7 @@ interval_div(PG_FUNCTION_ARGS)
23122310
Interval*span=PG_GETARG_INTERVAL_P(0);
23132311
float8factor=PG_GETARG_FLOAT8(1);
23142312
doublemonth_remainder,day_remainder;
2315-
Interval*result,*result2;
2313+
Interval*result;
23162314

23172315
result= (Interval*)palloc(sizeof(Interval));
23182316

@@ -2343,10 +2341,9 @@ interval_div(PG_FUNCTION_ARGS)
23432341
result->time=JROUND(result->time);
23442342
#endif
23452343

2346-
result2=DatumGetIntervalP(DirectFunctionCall1(interval_justify_hours,
2344+
result=DatumGetIntervalP(DirectFunctionCall1(interval_justify_hours,
23472345
IntervalPGetDatum(result)));
2348-
pfree(result);
2349-
PG_RETURN_INTERVAL_P(result2);
2346+
PG_RETURN_INTERVAL_P(result);
23502347
}
23512348

23522349
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp