@@ -4442,7 +4442,7 @@ PHP_PGSQL_API zend_result php_pgsql_meta_data(PGconn *pg_link, const zend_string
4442
4442
char * src , * tmp_name , * tmp_name2 = NULL ;
4443
4443
char * escaped ;
4444
4444
smart_str querystr = {0 };
4445
- size_t new_len ;
4445
+ size_t new_len , len ;
4446
4446
int i , num_rows ;
4447
4447
zval elem ;
4448
4448
@@ -4480,16 +4480,18 @@ PHP_PGSQL_API zend_result php_pgsql_meta_data(PGconn *pg_link, const zend_string
4480
4480
" JOIN pg_namespace n ON (c.relnamespace = n.oid) "
4481
4481
"WHERE a.attnum > 0 AND c.relname = '" );
4482
4482
}
4483
- escaped = (char * )safe_emalloc (strlen (tmp_name2 ), 2 , 1 );
4484
- new_len = PQescapeStringConn (pg_link , escaped , tmp_name2 , strlen (tmp_name2 ), NULL );
4483
+ len = strlen (tmp_name2 );
4484
+ escaped = (char * )safe_emalloc (len , 2 , 1 );
4485
+ new_len = PQescapeStringConn (pg_link , escaped , tmp_name2 , len , NULL );
4485
4486
if (new_len ) {
4486
4487
smart_str_appendl (& querystr , escaped , new_len );
4487
4488
}
4488
4489
efree (escaped );
4489
4490
4490
4491
smart_str_appends (& querystr , "' AND n.nspname = '" );
4491
- escaped = (char * )safe_emalloc (strlen (tmp_name ), 2 , 1 );
4492
- new_len = PQescapeStringConn (pg_link , escaped , tmp_name , strlen (tmp_name ), NULL );
4492
+ len = strlen (tmp_name );
4493
+ escaped = (char * )safe_emalloc (len , 2 , 1 );
4494
+ new_len = PQescapeStringConn (pg_link , escaped , tmp_name , len , NULL );
4493
4495
if (new_len ) {
4494
4496
smart_str_appendl (& querystr , escaped , new_len );
4495
4497
}
0 commit comments