@@ -497,25 +497,16 @@ static int pdo_odbc_handle_factory(pdo_dbh_t *dbh, zval *driver_options) /* {{{
497
497
char * uid = NULL , * pwd = NULL ;
498
498
bool should_quote_uid = !php_odbc_connstr_is_quoted (dbh -> username ) && php_odbc_connstr_should_quote (dbh -> username );
499
499
bool should_quote_pwd = !php_odbc_connstr_is_quoted (dbh -> password ) && php_odbc_connstr_should_quote (dbh -> password );
500
- bool connection_string_fail = false;
501
500
if (should_quote_uid ) {
502
501
size_t estimated_length = php_odbc_connstr_estimate_quote_length (dbh -> username );
503
502
uid = emalloc (estimated_length );
504
- if (!uid ) {
505
- connection_string_fail = true;
506
- goto connection_string_fail ;
507
- }
508
503
php_odbc_connstr_quote (uid , dbh -> username , estimated_length );
509
504
} else {
510
505
uid = dbh -> username ;
511
506
}
512
507
if (should_quote_pwd ) {
513
508
size_t estimated_length = php_odbc_connstr_estimate_quote_length (dbh -> password );
514
509
pwd = emalloc (estimated_length );
515
- if (!pwd ) {
516
- connection_string_fail = true;
517
- goto connection_string_fail ;
518
- }
519
510
php_odbc_connstr_quote (pwd , dbh -> password , estimated_length );
520
511
} else {
521
512
pwd = dbh -> password ;
@@ -524,25 +515,15 @@ static int pdo_odbc_handle_factory(pdo_dbh_t *dbh, zval *driver_options) /* {{{
524
515
+ strlen (uid ) + strlen (pwd )
525
516
+ strlen (";UID=;PWD=" ) + 1 ;
526
517
char * dsn = pemalloc (new_dsn_size , dbh -> is_persistent );
527
- if (dsn == NULL ) {
528
- connection_string_fail = true;
529
- /* XXX: Do we inform the caller? */
530
- goto connection_string_fail ;
531
- }
532
518
snprintf (dsn , new_dsn_size , "%s;UID=%s;PWD=%s" , dbh -> data_source , uid , pwd );
533
519
pefree ((char * )dbh -> data_source , dbh -> is_persistent );
534
520
dbh -> data_source = dsn ;
535
- /* Convoluted label to handle freeing in this scope */
536
- connection_string_fail :
537
521
if (uid && should_quote_uid ) {
538
522
efree (uid );
539
523
}
540
524
if (pwd && should_quote_pwd ) {
541
525
efree (pwd );
542
526
}
543
- if (connection_string_fail ) {
544
- goto fail ;
545
- }
546
527
}
547
528
548
529
rc = SQLDriverConnect (H -> dbc , NULL , (SQLCHAR * ) dbh -> data_source , strlen (dbh -> data_source ),
0 commit comments