@@ -602,12 +602,12 @@ static int pdo_mysql_handle_factory(pdo_dbh_t *dbh, zval *driver_options)
602
602
if (driver_options ) {
603
603
zend_long connect_timeout = pdo_attr_lval (driver_options , PDO_ATTR_TIMEOUT , 30 );
604
604
zend_long local_infile = pdo_attr_lval (driver_options , PDO_MYSQL_ATTR_LOCAL_INFILE , 0 );
605
- char * init_cmd = NULL ;
605
+ zend_string * init_cmd = NULL ;
606
606
#ifndef PDO_USE_MYSQLND
607
- char * default_file = NULL , * default_group = NULL ;
607
+ zend_string * default_file = NULL , * default_group = NULL ;
608
608
#endif
609
609
zend_long compress = 0 ;
610
- char * ssl_key = NULL , * ssl_cert = NULL , * ssl_ca = NULL , * ssl_capath = NULL , * ssl_cipher = NULL ;
610
+ zend_string * ssl_key = NULL , * ssl_cert = NULL , * ssl_ca = NULL , * ssl_capath = NULL , * ssl_cipher = NULL ;
611
611
H -> buffered = pdo_attr_lval (driver_options , PDO_MYSQL_ATTR_USE_BUFFERED_QUERY , 1 );
612
612
613
613
H -> emulate_prepare = pdo_attr_lval (driver_options ,
@@ -658,32 +658,32 @@ static int pdo_mysql_handle_factory(pdo_dbh_t *dbh, zval *driver_options)
658
658
#endif
659
659
init_cmd = pdo_attr_strval (driver_options , PDO_MYSQL_ATTR_INIT_COMMAND , NULL );
660
660
if (init_cmd ) {
661
- if (mysql_options (H -> server , MYSQL_INIT_COMMAND , (const char * )init_cmd )) {
662
- efree (init_cmd );
661
+ if (mysql_options (H -> server , MYSQL_INIT_COMMAND , (const char * )ZSTR_VAL ( init_cmd ) )) {
662
+ zend_string_release (init_cmd );
663
663
pdo_mysql_error (dbh );
664
664
goto cleanup ;
665
665
}
666
- efree (init_cmd );
666
+ zend_string_release (init_cmd );
667
667
}
668
668
#ifndef PDO_USE_MYSQLND
669
669
default_file = pdo_attr_strval (driver_options , PDO_MYSQL_ATTR_READ_DEFAULT_FILE , NULL );
670
670
if (default_file ) {
671
- if (mysql_options (H -> server , MYSQL_READ_DEFAULT_FILE , (const char * )default_file )) {
672
- efree (default_file );
671
+ if (mysql_options (H -> server , MYSQL_READ_DEFAULT_FILE , (const char * )ZSTR_VAL ( default_file ) )) {
672
+ zend_string_release (default_file );
673
673
pdo_mysql_error (dbh );
674
674
goto cleanup ;
675
675
}
676
- efree (default_file );
676
+ zend_string_release (default_file );
677
677
}
678
678
679
- default_group = pdo_attr_strval (driver_options , PDO_MYSQL_ATTR_READ_DEFAULT_GROUP , NULL );
679
+ default_group = pdo_attr_strval (driver_options , PDO_MYSQL_ATTR_READ_DEFAULT_GROUP , NULL );
680
680
if (default_group ) {
681
- if (mysql_options (H -> server , MYSQL_READ_DEFAULT_GROUP , (const char * )default_group )) {
682
- efree (default_group );
681
+ if (mysql_options (H -> server , MYSQL_READ_DEFAULT_GROUP , (const char * )ZSTR_VAL ( default_group ) )) {
682
+ zend_string_release (default_group );
683
683
pdo_mysql_error (dbh );
684
684
goto cleanup ;
685
685
}
686
- efree (default_group );
686
+ zend_string_release (default_group );
687
687
}
688
688
#endif
689
689
compress = pdo_attr_lval (driver_options , PDO_MYSQL_ATTR_COMPRESS , 0 );
@@ -701,34 +701,39 @@ static int pdo_mysql_handle_factory(pdo_dbh_t *dbh, zval *driver_options)
701
701
ssl_cipher = pdo_attr_strval (driver_options , PDO_MYSQL_ATTR_SSL_CIPHER , NULL );
702
702
703
703
if (ssl_key || ssl_cert || ssl_ca || ssl_capath || ssl_cipher ) {
704
- mysql_ssl_set (H -> server , ssl_key , ssl_cert , ssl_ca , ssl_capath , ssl_cipher );
704
+ mysql_ssl_set (H -> server ,
705
+ ssl_key ? ZSTR_VAL (ssl_key ) : NULL ,
706
+ ssl_cert ? ZSTR_VAL (ssl_cert ) : NULL ,
707
+ ssl_ca ? ZSTR_VAL (ssl_ca ) : NULL ,
708
+ ssl_capath ? ZSTR_VAL (ssl_capath ) : NULL ,
709
+ ssl_cipher ? ZSTR_VAL (ssl_cipher ) : NULL );
705
710
if (ssl_key ) {
706
- efree (ssl_key );
711
+ zend_string_release (ssl_key );
707
712
}
708
713
if (ssl_cert ) {
709
- efree (ssl_cert );
714
+ zend_string_release (ssl_cert );
710
715
}
711
716
if (ssl_ca ) {
712
- efree (ssl_ca );
717
+ zend_string_release (ssl_ca );
713
718
}
714
719
if (ssl_capath ) {
715
- efree (ssl_capath );
720
+ zend_string_release (ssl_capath );
716
721
}
717
722
if (ssl_cipher ) {
718
- efree (ssl_cipher );
723
+ zend_string_release (ssl_cipher );
719
724
}
720
725
}
721
726
722
727
#if MYSQL_VERSION_ID > 50605 || defined(PDO_USE_MYSQLND )
723
728
{
724
- char * public_key = pdo_attr_strval (driver_options , PDO_MYSQL_ATTR_SERVER_PUBLIC_KEY , NULL );
729
+ zend_string * public_key = pdo_attr_strval (driver_options , PDO_MYSQL_ATTR_SERVER_PUBLIC_KEY , NULL );
725
730
if (public_key ) {
726
- if (mysql_options (H -> server , MYSQL_SERVER_PUBLIC_KEY , public_key )) {
731
+ if (mysql_options (H -> server , MYSQL_SERVER_PUBLIC_KEY , ZSTR_VAL ( public_key ) )) {
727
732
pdo_mysql_error (dbh );
728
- efree (public_key );
733
+ zend_string_release (public_key );
729
734
goto cleanup ;
730
735
}
731
- efree (public_key );
736
+ zend_string_release (public_key );
732
737
}
733
738
}
734
739
#endif
0 commit comments