@ -151,10 +151,10 @@ unlimit_core_size(void)
void
void
add_stringlist_item ( _stringlist * * listhead , const char * str )
add_stringlist_item ( _stringlist * * listhead , const char * str )
{
{
_stringlist * newentry = malloc ( sizeof ( _stringlist ) ) ;
_stringlist * newentry = pg_ malloc( sizeof ( _stringlist ) ) ;
_stringlist * oldentry ;
_stringlist * oldentry ;
newentry - > str = strdup ( str ) ;
newentry - > str = pg_ strdup( str ) ;
newentry - > next = NULL ;
newentry - > next = NULL ;
if ( * listhead = = NULL )
if ( * listhead = = NULL )
* listhead = newentry ;
* listhead = newentry ;
@ -187,7 +187,7 @@ free_stringlist(_stringlist **listhead)
static void
static void
split_to_stringlist ( const char * s , const char * delim , _stringlist * * listhead )
split_to_stringlist ( const char * s , const char * delim , _stringlist * * listhead )
{
{
char * sc = strdup ( s ) ;
char * sc = pg_ strdup( s ) ;
char * token = strtok ( sc , delim ) ;
char * token = strtok ( sc , delim ) ;
while ( token )
while ( token )
@ -327,7 +327,7 @@ signal_remove_temp(int signum)
static const char *
static const char *
make_temp_sockdir ( void )
make_temp_sockdir ( void )
{
{
char * template = strdup ( " /tmp/pg_regress-XXXXXX " ) ;
char * template = pg_ strdup( " /tmp/pg_regress-XXXXXX " ) ;
temp_sockdir = mkdtemp ( template ) ;
temp_sockdir = mkdtemp ( template ) ;
if ( temp_sockdir = = NULL )
if ( temp_sockdir = = NULL )
@ -441,7 +441,7 @@ replace_string(char *string, char *replace, char *replacement)
while ( ( ptr = strstr ( string , replace ) ) ! = NULL )
while ( ( ptr = strstr ( string , replace ) ) ! = NULL )
{
{
char * dup = strdup ( string ) ;
char * dup = pg_ strdup( string ) ;
strlcpy ( string , dup , ptr - string + 1 ) ;
strlcpy ( string , dup , ptr - string + 1 ) ;
strcat ( string , replacement ) ;
strcat ( string , replacement ) ;
@ -661,11 +661,11 @@ load_resultmap(void)
*/
*/
if ( string_matches_pattern ( host_platform , platform ) )
if ( string_matches_pattern ( host_platform , platform ) )
{
{
_resultmap * entry = malloc ( sizeof ( _resultmap ) ) ;
_resultmap * entry = pg_ malloc( sizeof ( _resultmap ) ) ;
entry - > test = strdup ( buf ) ;
entry - > test = pg_ strdup( buf ) ;
entry - > type = strdup ( file_type ) ;
entry - > type = pg_ strdup( file_type ) ;
entry - > resultfile = strdup ( expected ) ;
entry - > resultfile = pg_ strdup( expected ) ;
entry - > next = resultmap ;
entry - > next = resultmap ;
resultmap = entry ;
resultmap = entry ;
}
}
@ -908,7 +908,7 @@ current_windows_user(const char **acct, const char **dom)
progname , GetLastError ( ) ) ;
progname , GetLastError ( ) ) ;
exit ( 2 ) ;
exit ( 2 ) ;
}
}
tokenuser = malloc ( retlen ) ;
tokenuser = pg_ malloc( retlen ) ;
if ( ! GetTokenInformation ( token , TokenUser , tokenuser , retlen , & retlen ) )
if ( ! GetTokenInformation ( token , TokenUser , tokenuser , retlen , & retlen ) )
{
{
fprintf ( stderr ,
fprintf ( stderr ,
@ -1460,7 +1460,7 @@ wait_for_tests(PID_TYPE * pids, int *statuses, char **names, int num_tests)
int i ;
int i ;
# ifdef WIN32
# ifdef WIN32
PID_TYPE * active_pids = malloc ( num_tests * sizeof ( PID_TYPE ) ) ;
PID_TYPE * active_pids = pg_ malloc( num_tests * sizeof ( PID_TYPE ) ) ;
memcpy ( active_pids , pids , num_tests * sizeof ( PID_TYPE ) ) ;
memcpy ( active_pids , pids , num_tests * sizeof ( PID_TYPE ) ) ;
# endif
# endif
@ -1848,7 +1848,7 @@ open_result_files(void)
/* create the log file (copy of running status output) */
/* create the log file (copy of running status output) */
snprintf ( file , sizeof ( file ) , " %s/regression.out " , outputdir ) ;
snprintf ( file , sizeof ( file ) , " %s/regression.out " , outputdir ) ;
logfilename = strdup ( file ) ;
logfilename = pg_ strdup( file ) ;
logfile = fopen ( logfilename , " w " ) ;
logfile = fopen ( logfilename , " w " ) ;
if ( ! logfile )
if ( ! logfile )
{
{
@ -1859,7 +1859,7 @@ open_result_files(void)
/* create the diffs file as empty */
/* create the diffs file as empty */
snprintf ( file , sizeof ( file ) , " %s/regression.diffs " , outputdir ) ;
snprintf ( file , sizeof ( file ) , " %s/regression.diffs " , outputdir ) ;
difffilename = strdup ( file ) ;
difffilename = pg_ strdup( file ) ;
difffile = fopen ( difffilename , " w " ) ;
difffile = fopen ( difffilename , " w " ) ;
if ( ! difffile )
if ( ! difffile )
{
{
@ -2064,13 +2064,13 @@ regression_main(int argc, char *argv[], init_function ifunc, test_function tfunc
* before we add the specified one .
* before we add the specified one .
*/
*/
free_stringlist ( & dblist ) ;
free_stringlist ( & dblist ) ;
split_to_stringlist ( strdup ( optarg ) , " , " , & dblist ) ;
split_to_stringlist ( pg_ strdup( optarg ) , " , " , & dblist ) ;
break ;
break ;
case 2 :
case 2 :
debug = true ;
debug = true ;
break ;
break ;
case 3 :
case 3 :
inputdir = strdup ( optarg ) ;
inputdir = pg_ strdup( optarg ) ;
break ;
break ;
case 4 :
case 4 :
add_stringlist_item ( & loadlanguage , optarg ) ;
add_stringlist_item ( & loadlanguage , optarg ) ;
@ -2079,10 +2079,10 @@ regression_main(int argc, char *argv[], init_function ifunc, test_function tfunc
max_connections = atoi ( optarg ) ;
max_connections = atoi ( optarg ) ;
break ;
break ;
case 6 :
case 6 :
encoding = strdup ( optarg ) ;
encoding = pg_ strdup( optarg ) ;
break ;
break ;
case 7 :
case 7 :
outputdir = strdup ( optarg ) ;
outputdir = pg_ strdup( optarg ) ;
break ;
break ;
case 8 :
case 8 :
add_stringlist_item ( & schedulelist , optarg ) ;
add_stringlist_item ( & schedulelist , optarg ) ;
@ -2094,27 +2094,27 @@ regression_main(int argc, char *argv[], init_function ifunc, test_function tfunc
nolocale = true ;
nolocale = true ;
break ;
break ;
case 13 :
case 13 :
hostname = strdup ( optarg ) ;
hostname = pg_ strdup( optarg ) ;
break ;
break ;
case 14 :
case 14 :
port = atoi ( optarg ) ;
port = atoi ( optarg ) ;
port_specified_by_user = true ;
port_specified_by_user = true ;
break ;
break ;
case 15 :
case 15 :
user = strdup ( optarg ) ;
user = pg_ strdup( optarg ) ;
break ;
break ;
case 16 :
case 16 :
/* "--bindir=" means to use PATH */
/* "--bindir=" means to use PATH */
if ( strlen ( optarg ) )
if ( strlen ( optarg ) )
bindir = strdup ( optarg ) ;
bindir = pg_ strdup( optarg ) ;
else
else
bindir = NULL ;
bindir = NULL ;
break ;
break ;
case 17 :
case 17 :
dlpath = strdup ( optarg ) ;
dlpath = pg_ strdup( optarg ) ;
break ;
break ;
case 18 :
case 18 :
split_to_stringlist ( strdup ( optarg ) , " , " , & extraroles ) ;
split_to_stringlist ( pg_ strdup( optarg ) , " , " , & extraroles ) ;
break ;
break ;
case 19 :
case 19 :
add_stringlist_item ( & temp_configs , optarg ) ;
add_stringlist_item ( & temp_configs , optarg ) ;
@ -2123,13 +2123,13 @@ regression_main(int argc, char *argv[], init_function ifunc, test_function tfunc
use_existing = true ;
use_existing = true ;
break ;
break ;
case 21 :
case 21 :
launcher = strdup ( optarg ) ;
launcher = pg_ strdup( optarg ) ;
break ;
break ;
case 22 :
case 22 :
add_stringlist_item ( & loadextension , optarg ) ;
add_stringlist_item ( & loadextension , optarg ) ;
break ;
break ;
case 24 :
case 24 :
config_auth_datadir = pstrdup ( optarg ) ;
config_auth_datadir = pg_ strdup ( optarg ) ;
break ;
break ;
default :
default :
/* getopt_long already emitted a complaint */
/* getopt_long already emitted a complaint */