summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorAndrey Hristov <andrey@php.net>2010-05-25 22:36:33 (GMT)
committerAndrey Hristov <andrey@php.net>2010-05-25 22:36:33 (GMT)
commitb434301f7b5e5d4e37dc8860b6a2462569f1dff6 (patch)
tree425cb55d7c4debdb69327e6057eb2f03338a0aea /ext
parentdecdfeeeb28e652ce01dbe02697e21ed4baf46fa (diff)
downloadphp-b434301f7b5e5d4e37dc8860b6a2462569f1dff6.tar.gz
Use only memory that has been allocated
Diffstat (limited to 'ext')
-rw-r--r--ext/mysqlnd/mysqlnd_net.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/ext/mysqlnd/mysqlnd_net.c b/ext/mysqlnd/mysqlnd_net.c
index 5a3fda5..f169506 100644
--- a/ext/mysqlnd/mysqlnd_net.c
+++ b/ext/mysqlnd/mysqlnd_net.c
@@ -885,13 +885,14 @@ mysqlnd_net_init(zend_bool persistent TSRMLS_DC)
DBG_ENTER("mysqlnd_net_init");
DBG_INF_FMT("persistent=%d", persistent);
- net->persistent = persistent;
-
- net->m = mysqlnd_mysqlnd_net_methods;
+ if (net) {
+ net->persistent = persistent;
+ net->m = mysqlnd_mysqlnd_net_methods;
- {
- unsigned int buf_size = MYSQLND_G(net_cmd_buffer_size); /* this is long, cast to unsigned int*/
- net->m.set_client_option(net, MYSQLND_OPT_NET_CMD_BUFFER_SIZE, (char *) &buf_size TSRMLS_CC);
+ {
+ unsigned int buf_size = MYSQLND_G(net_cmd_buffer_size); /* this is long, cast to unsigned int*/
+ net->m.set_client_option(net, MYSQLND_OPT_NET_CMD_BUFFER_SIZE, (char *) &buf_size TSRMLS_CC);
+ }
}
DBG_RETURN(net);
}