1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2024-12-14 10:13:05 +02:00

Fix leak in archivePushDropWarning().

This commit is contained in:
David Steele 2023-01-10 11:17:08 +07:00
parent bf9e331ac1
commit 675b4ae251

View File

@ -41,15 +41,19 @@ Ready file extension constants
Format the warning when a file is dropped Format the warning when a file is dropped
***********************************************************************************************************************************/ ***********************************************************************************************************************************/
static String * static String *
archivePushDropWarning(const String *walFile, uint64_t queueMax) archivePushDropWarning(const String *const walFile, const uint64_t queueMax)
{ {
FUNCTION_TEST_BEGIN(); FUNCTION_TEST_BEGIN();
FUNCTION_TEST_PARAM(STRING, walFile); FUNCTION_TEST_PARAM(STRING, walFile);
FUNCTION_TEST_PARAM(UINT64, queueMax); FUNCTION_TEST_PARAM(UINT64, queueMax);
FUNCTION_TEST_END(); FUNCTION_TEST_END();
FUNCTION_TEST_RETURN( String *const size = strSizeFormat(queueMax);
STRING, strNewFmt("dropped WAL file '%s' because archive queue exceeded %s", strZ(walFile), strZ(strSizeFormat(queueMax)))); String *const result = strNewFmt("dropped WAL file '%s' because archive queue exceeded %s", strZ(walFile), strZ(size));
strFree(size);
FUNCTION_TEST_RETURN(STRING, result);
} }
/*********************************************************************************************************************************** /***********************************************************************************************************************************