summaryrefslogtreecommitdiff
path: root/ext/mysql/php_mysql.c
diff options
context:
space:
mode:
authorShane Caraveo <shane@php.net>2001-02-21 23:57:28 +0000
committerShane Caraveo <shane@php.net>2001-02-21 23:57:28 +0000
commit6e31987376e066b4fb856c2f619e78bb49222e23 (patch)
treefc62cd11576765bc5aa5702db64528ef567552d8 /ext/mysql/php_mysql.c
parent977b9ddc0101045b1e553ab4f859f6bca0572613 (diff)
downloadphp-git-6e31987376e066b4fb856c2f619e78bb49222e23.tar.gz
Initalize some of the global vars. Crashed under ms debugger without having them initialized.
Diffstat (limited to 'ext/mysql/php_mysql.c')
-rw-r--r--ext/mysql/php_mysql.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/ext/mysql/php_mysql.c b/ext/mysql/php_mysql.c
index b2a6b94494..c9c1458458 100644
--- a/ext/mysql/php_mysql.c
+++ b/ext/mysql/php_mysql.c
@@ -274,6 +274,10 @@ PHP_INI_END()
static void php_mysql_init_globals(zend_mysql_globals *mysql_globals)
{
mysql_globals->num_persistent = 0;
+ mysql_globals->default_socket = NULL;
+ mysql_globals->default_host = NULL;
+ mysql_globals->default_user = NULL;
+ mysql_globals->default_password = NULL;
}
@@ -349,10 +353,10 @@ PHP_MINFO_FUNCTION(mysql)
static void php_mysql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
{
- char *user, *passwd, *host_and_port, *socket, *tmp, *host=NULL;
- char *hashed_details;
+ char *user=NULL, *passwd=NULL, *host_and_port=NULL, *socket=NULL, *tmp=NULL, *host=NULL;
+ char *hashed_details=NULL;
int hashed_details_length, port = MYSQL_PORT;
- MYSQL *mysql;
+ MYSQL *mysql=NULL;
void (*handler) (int);
zval **z_host=NULL, **z_user=NULL, **z_passwd=NULL;
zend_bool free_host=0;