1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-03 20:02:46 +03:00

Fix a few places that were checking for the return value of palloc() to be

non-NULL: palloc() ereports on OOM, so we can safely assume it returns a
valid pointer.
This commit is contained in:
Neil Conway
2006-03-19 22:22:56 +00:00
parent 381cb046ed
commit a323ede280
5 changed files with 12 additions and 37 deletions

View File

@ -1,7 +1,7 @@
/**********************************************************************
* plperl.c - perl as a procedural language for PostgreSQL
*
* $PostgreSQL: pgsql/src/pl/plperl/plperl.c,v 1.106 2006/03/14 22:48:23 tgl Exp $
* $PostgreSQL: pgsql/src/pl/plperl/plperl.c,v 1.107 2006/03/19 22:22:56 neilc Exp $
*
**********************************************************************/
@ -2122,8 +2122,6 @@ plperl_spi_exec_prepared(char* query, HV * attr, int argc, SV ** argv)
{
nulls = (char *)palloc( argc);
argvalues = (Datum *) palloc(argc * sizeof(Datum));
if ( nulls == NULL || argvalues == NULL)
elog(ERROR, "spi_exec_prepared: not enough memory");
}
else
{
@ -2253,8 +2251,6 @@ plperl_spi_query_prepared(char* query, int argc, SV ** argv)
{
nulls = (char *)palloc( argc);
argvalues = (Datum *) palloc(argc * sizeof(Datum));
if ( nulls == NULL || argvalues == NULL)
elog(ERROR, "spi_query_prepared: not enough memory");
}
else
{