--- embedaddon/php/ext/pdo/pdo_dbh.c 2013/10/14 08:02:24 1.1.1.4 +++ embedaddon/php/ext/pdo/pdo_dbh.c 2014/06/15 20:03:51 1.1.1.5 @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: pdo_dbh.c,v 1.1.1.4 2013/10/14 08:02:24 misho Exp $ */ +/* $Id: pdo_dbh.c,v 1.1.1.5 2014/06/15 20:03:51 misho Exp $ */ /* The PDO Database Handle Class */ @@ -196,7 +196,7 @@ static char *dsn_from_uri(char *uri, char *buf, size_t } /* }}} */ -/* {{{ proto void PDO::__construct(string dsn, string username, string passwd [, array options]) +/* {{{ proto void PDO::__construct(string dsn[, string username[, string passwd [, array options]]]) */ static PHP_METHOD(PDO, dbh_constructor) { @@ -460,7 +460,7 @@ static void pdo_stmt_construct(pdo_stmt_t *stmt, zval if (dbstmt_ce->constructor) { zend_fcall_info fci; zend_fcall_info_cache fcc; - zval *retval; + zval *retval = NULL; fci.size = sizeof(zend_fcall_info); fci.function_table = &dbstmt_ce->function_table; @@ -495,7 +495,7 @@ static void pdo_stmt_construct(pdo_stmt_t *stmt, zval zval_dtor(object); ZVAL_NULL(object); object = NULL; /* marks failure */ - } else { + } else if (retval) { zval_ptr_dtor(&retval); } @@ -1226,7 +1226,7 @@ static PHP_METHOD(PDO, getAvailableDrivers) /* }}} */ /* {{{ arginfo */ -ZEND_BEGIN_ARG_INFO_EX(arginfo_pdo___construct, 0, 0, 3) +ZEND_BEGIN_ARG_INFO_EX(arginfo_pdo___construct, 0, 0, 1) ZEND_ARG_INFO(0, dsn) ZEND_ARG_INFO(0, username) ZEND_ARG_INFO(0, passwd)