提交 6a8f8cb5 编写于 作者: B Bhuvnesh Chaudhary

upgrade: pg_strdup should not be run on the bool params

optarg is a global and is not required to be passed to
process_greenplum_option. Also, for bool parameters pg_strdup must not
be called else it will fail with cannot duplicate null pointer (internal error)
上级 b00b94ef
......@@ -29,7 +29,7 @@ initialize_greenplum_user_options(void)
}
bool
process_greenplum_option(greenplumOption option, char *option_value)
process_greenplum_option(greenplumOption option)
{
switch (option)
{
......
......@@ -68,7 +68,7 @@ typedef enum {
/* option_gp.c */
void initialize_greenplum_user_options(void);
bool process_greenplum_option(greenplumOption option, char *option_value);
bool process_greenplum_option(greenplumOption option);
bool is_greenplum_dispatcher_mode(void);
bool is_checksum_mode(checksumMode mode);
bool is_show_progress_mode(void);
......
......@@ -197,7 +197,7 @@ parseCommandLine(int argc, char *argv[])
break;
default:
if (!process_greenplum_option(option, pg_strdup(optarg)))
if (!process_greenplum_option(option))
pg_fatal("Try \"%s --help\" for more information.\n",
os_info.progname);
break;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册