Skip to content

Commit

Permalink
Fix crash in pgstat_init_function_usage (#1935)
Browse files Browse the repository at this point in the history
Crash in pgstat_init_function_usage_wrapper due to the ReleaseSysCache is being called even if proctup is Invalid. ReleaseSysCache on proctup should only be called when proctup is validated by HeapTupleIsValid. 

Task: BABEL-4466
Signed-off-by: Parikshit Sarode [email protected]
  • Loading branch information
ParikshitSarode authored Oct 20, 2023
1 parent 0fd93b3 commit f9734a3
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions contrib/babelfishpg_tsql/src/hooks.c
Original file line number Diff line number Diff line change
Expand Up @@ -798,12 +798,10 @@ pgstat_init_function_usage_wrapper(FunctionCallInfo fcinfo,
{
Form_pg_proc proc = (Form_pg_proc) GETSTRUCT(proctup);
pre_wrapper_pgstat_init_function_usage(NameStr(proc->proname));
ReleaseSysCache(proctup);
}

ReleaseSysCache(proctup);
}
}

}

static Node *
Expand Down

0 comments on commit f9734a3

Please sign in to comment.