diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index c8c687d6f51..416cbd60909 100644 --- a/src/backend/tcop/postgres.c +++ b/src/backend/tcop/postgres.c @@ -3674,6 +3674,11 @@ check_restrict_nonsystem_relation_kind(char **newval, void **extra, GucSource so /* Save the flags in *extra, for use by the assign function */ *extra = malloc(sizeof(int)); + if (*extra == NULL) + ereport(ERROR, + (errcode(ERRCODE_OUT_OF_MEMORY), + errmsg("out of memory"))); + *((int *) *extra) = flags; return true;