diff options
author | Xinchen Hui <laruence@php.net> | 2014-05-19 14:44:59 +0800 |
---|---|---|
committer | Xinchen Hui <laruence@php.net> | 2014-05-19 14:44:59 +0800 |
commit | ed554704f3d50768653bbb0c17cc7b47e08dc790 (patch) | |
tree | ae66c57073509f600abe88b6f8c235f72ce17f80 /ext/pgsql/pgsql.c | |
parent | 1ff7c7b9a31bd3242b06436740322f7246a708f0 (diff) | |
download | php-git-ed554704f3d50768653bbb0c17cc7b47e08dc790.tar.gz |
Fixed segfault
Diffstat (limited to 'ext/pgsql/pgsql.c')
-rw-r--r-- | ext/pgsql/pgsql.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index c6843c29ca..57903104f5 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -983,7 +983,6 @@ static void _php_pgsql_notice_ptr_dtor(zval *el) if (notice) { efree(notice->message); efree(notice); - notice = NULL; } } /* }}} */ @@ -1273,8 +1272,10 @@ static void php_pgsql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) int i, connect_type = 0; PGresult *pg_result; + args = (zval *)safe_emalloc(ZEND_NUM_ARGS(), sizeof(zval), 0); if (ZEND_NUM_ARGS() < 1 || ZEND_NUM_ARGS() > 5 || zend_get_parameters_array_ex(ZEND_NUM_ARGS(), args) == FAILURE) { + efree(args); WRONG_PARAM_COUNT; } @@ -1318,6 +1319,7 @@ static void php_pgsql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) break; } } + efree(args); if (persistent && PGG(allow_persistent)) { zend_resource *le; |