diff options
author | Marcus Boerger <helly@php.net> | 2006-04-10 19:48:27 +0000 |
---|---|---|
committer | Marcus Boerger <helly@php.net> | 2006-04-10 19:48:27 +0000 |
commit | 40678e7f812b85d1b97c9934a08fe2eed97c4135 (patch) | |
tree | 0c5f62e4e3f5dd1e875c568e21a3f8fd8b4e473c | |
parent | af871bf437082cb0cbe4d485f5de6c901ba45132 (diff) | |
download | php-git-40678e7f812b85d1b97c9934a08fe2eed97c4135.tar.gz |
- Fix possible SEGV
-rw-r--r-- | ext/pgsql/pgsql.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index 69748001ee..02f15232b6 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -4586,7 +4586,7 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con char *field = NULL; uint field_len = -1; ulong num_idx = -1; - zval *meta, **def, **type, **not_null, **has_default, **val, *new_val; + zval *meta, **def, **type, **not_null, **has_default, **val, *new_val = NULL; int new_len, key_type, err = 0, skip_field; assert(pg_link != NULL); @@ -4646,7 +4646,7 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con if (err) { break; /* break out for() */ } - MAKE_STD_ZVAL(new_val); + ALLOC_INIT_ZVAL(new_val); switch(php_pgsql_get_data_type(Z_STRVAL_PP(type), Z_STRLEN_PP(type))) { case PG_BOOL: @@ -5178,7 +5178,7 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con break; } /* switch */ - if (err) { + if (err && new_val) { zval_dtor(new_val); FREE_ZVAL(new_val); break; /* break out for() */ |