summaryrefslogtreecommitdiff
path: root/src/pl
diff options
context:
space:
mode:
authorNeil Conway2006-03-19 22:22:56 +0000
committerNeil Conway2006-03-19 22:22:56 +0000
commita323ede2802956f115d71599514fbc01f2575dee (patch)
tree8d2bf7809a9c007563342c3dff8096e8e5acc8f5 /src/pl
parent381cb046ed60a1164a244e2f9aa28b8128ea2ac5 (diff)
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.
Diffstat (limited to 'src/pl')
-rw-r--r--src/pl/plperl/SPI.xs6
-rw-r--r--src/pl/plperl/plperl.c6
2 files changed, 1 insertions, 11 deletions
diff --git a/src/pl/plperl/SPI.xs b/src/pl/plperl/SPI.xs
index 738cbb61842..967ac0adbab 100644
--- a/src/pl/plperl/SPI.xs
+++ b/src/pl/plperl/SPI.xs
@@ -151,8 +151,6 @@ spi_spi_prepare(query, ...)
if (items < 1)
Perl_croak(aTHX_ "Usage: spi_prepare(query, ...)");
argv = ( SV**) palloc(( items - 1) * sizeof(SV*));
- if ( argv == NULL)
- Perl_croak(aTHX_ "spi_prepare: not enough memory");
for ( i = 1; i < items; i++)
argv[i - 1] = ST(i);
RETVAL = plperl_spi_prepare(query, items - 1, argv);
@@ -179,8 +177,6 @@ spi_spi_exec_prepared(query, ...)
}
argc = items - offset;
argv = ( SV**) palloc( argc * sizeof(SV*));
- if ( argv == NULL)
- Perl_croak(aTHX_ "spi_exec_prepared: not enough memory");
for ( i = 0; offset < items; offset++, i++)
argv[i] = ST(offset);
ret_hash = plperl_spi_exec_prepared(query, attr, argc, argv);
@@ -199,8 +195,6 @@ spi_spi_query_prepared(query, ...)
Perl_croak(aTHX_ "Usage: spi_query_prepared(query, "
"[\\@bind_values])");
argv = ( SV**) palloc(( items - 1) * sizeof(SV*));
- if ( argv == NULL)
- Perl_croak(aTHX_ "spi_query_prepared: not enough memory");
for ( i = 1; i < items; i++)
argv[i - 1] = ST(i);
RETVAL = plperl_spi_query_prepared(query, items - 1, argv);
diff --git a/src/pl/plperl/plperl.c b/src/pl/plperl/plperl.c
index 362bf774725..0524d9ebe4e 100644
--- a/src/pl/plperl/plperl.c
+++ b/src/pl/plperl/plperl.c
@@ -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
{