aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dunstan <andrew@dunslane.net>2010-01-28 23:06:09 +0000
committerAndrew Dunstan <andrew@dunslane.net>2010-01-28 23:06:09 +0000
commit1f98cccb941823d241120ca86df264d7ebbcaec5 (patch)
treec9aecf055cbbfcb7871c16f4d6ad942687314c8e
parentb0509ef6016abf1133a9d85dd4f60b865ee9f90b (diff)
downloadpostgresql-1f98cccb941823d241120ca86df264d7ebbcaec5.tar.gz
postgresql-1f98cccb941823d241120ca86df264d7ebbcaec5.zip
Fix bug found by warning from recent gcc. patch from Tim Bunce.
-rw-r--r--src/pl/plperl/plperl.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/pl/plperl/plperl.c b/src/pl/plperl/plperl.c
index 09ffe3047ba..1a1e264e9d4 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.161 2010/01/26 23:11:56 adunstan Exp $
+ * $PostgreSQL: pgsql/src/pl/plperl/plperl.c,v 1.162 2010/01/28 23:06:09 adunstan Exp $
*
**********************************************************************/
@@ -1113,8 +1113,11 @@ plperl_create_sub(plperl_proc_desc *prodesc, char *s, Oid fn_oid)
if (count == 1) {
GV *sub_glob = (GV*)POPs;
- if (sub_glob && SvTYPE(sub_glob) == SVt_PVGV)
- subref = newRV_inc((SV*)GvCVu((GV*)sub_glob));
+ if (sub_glob && SvTYPE(sub_glob) == SVt_PVGV) {
+ SV *sv = (SV*)GvCVu((GV*)sub_glob);
+ if (sv)
+ subref = newRV_inc(sv);
+ }
}
PUTBACK;