1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-07-05 00:28:52 +02:00

Add strLstNewFmt().

Simplifies adding a formatted string to a list and removes a common cause of leaks.
This commit is contained in:
David Steele
2022-04-25 11:47:43 -04:00
parent 3475514b61
commit 7900660d3a
17 changed files with 78 additions and 60 deletions

View File

@ -572,7 +572,7 @@ pgLsnRangeToWalSegmentList(
unsigned int minorPerMajor = 0xFFFFFFFF / walSegmentSize;
// Create list
strLstAdd(result, strNewFmt("%08X%08X%08X", timeline, startMajor, startMinor));
strLstAddFmt(result, "%08X%08X%08X", timeline, startMajor, startMinor);
while (!(startMajor == stopMajor && startMinor == stopMinor))
{
@ -584,7 +584,7 @@ pgLsnRangeToWalSegmentList(
startMinor = 0;
}
strLstAdd(result, strNewFmt("%08X%08X%08X", timeline, startMajor, startMinor));
strLstAddFmt(result, "%08X%08X%08X", timeline, startMajor, startMinor);
}
strLstMove(result, memContextPrior());