File tree 1 file changed +3
-1
lines changed
1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -1322,7 +1322,7 @@ pg_stat_get_wal_senders(PG_FUNCTION_ARGS)
1322
1322
Tuplestorestate * tupstore ;
1323
1323
MemoryContext per_query_ctx ;
1324
1324
MemoryContext oldcontext ;
1325
- int sync_priority [ max_wal_senders ] ;
1325
+ int * sync_priority ;
1326
1326
int priority = 0 ;
1327
1327
int sync_standby = -1 ;
1328
1328
int i ;
@@ -1357,6 +1357,7 @@ pg_stat_get_wal_senders(PG_FUNCTION_ARGS)
1357
1357
* lock acquisitions and to allow us to evaluate who is the current
1358
1358
* sync standby. This code must match the code in SyncRepReleaseWaiters().
1359
1359
*/
1360
+ sync_priority = palloc (sizeof (int ) * max_wal_senders );
1360
1361
LWLockAcquire (SyncRepLock , LW_SHARED );
1361
1362
for (i = 0 ; i < max_wal_senders ; i ++ )
1362
1363
{
@@ -1456,6 +1457,7 @@ pg_stat_get_wal_senders(PG_FUNCTION_ARGS)
1456
1457
1457
1458
tuplestore_putvalues (tupstore , tupdesc , values , nulls );
1458
1459
}
1460
+ pfree (sync_priority );
1459
1461
1460
1462
/* clean up and return the tuplestore */
1461
1463
tuplestore_donestoring (tupstore );
You can’t perform that action at this time.
0 commit comments