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

Commit7911e78

Browse files
committed
Silence compiler warnings
In GetCachedPlan(), initialize 'plan' to silence a compiler warning, butalso add an Assert() to make sure we don't ever actually fall throughwith 'plan' still being set to NULL, since we are about to dereferenceit.Back-patch back to 9.2.Author: Stephen FrostDiscussion:https://postgr.es/m/20161129152102.GR13284%40tamriel.snowman.net
1 parentf7e7d6f commit7911e78

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

‎src/backend/utils/cache/plancache.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1141,7 +1141,7 @@ CachedPlan *
11411141
GetCachedPlan(CachedPlanSource*plansource,ParamListInfoboundParams,
11421142
booluseResOwner)
11431143
{
1144-
CachedPlan*plan;
1144+
CachedPlan*plan=NULL;
11451145
List*qlist;
11461146
boolcustomplan;
11471147

@@ -1223,6 +1223,8 @@ GetCachedPlan(CachedPlanSource *plansource, ParamListInfo boundParams,
12231223
}
12241224
}
12251225

1226+
Assert(plan!=NULL);
1227+
12261228
/* Flag the plan as in use by caller */
12271229
if (useResOwner)
12281230
ResourceOwnerEnlargePlanCacheRefs(CurrentResourceOwner);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp