don't try to fetch resource when there is 0 args
authorAntony Dovgal <tony2001@php.net>
Wed, 7 Sep 2005 08:58:32 +0000 (08:58 +0000)
committerAntony Dovgal <tony2001@php.net>
Wed, 7 Sep 2005 08:58:32 +0000 (08:58 +0000)
ext/oci8/oci8_interface.c

index 70570289469ed4e6a151e5f7e36f97d6b9906377..1659aa3f0fc72b13dc640601cfb4ae0a4292350b 100644 (file)
@@ -1499,7 +1499,11 @@ PHP_FUNCTION(oci_error)
        text *sqltext = NULL;
 #endif
 
-       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|r", &arg) == SUCCESS) {
+       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|r", &arg) == FAILURE) {
+               return;
+       }
+
+       if (ZEND_NUM_ARGS() > 0) {
                statement = (php_oci_statement *) zend_fetch_resource(&arg TSRMLS_CC, -1, NULL, NULL, 1, le_statement);
        
                if (statement) {