You've already forked pgbackrest
mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2025-07-15 01:04:37 +02:00
Use OBJ_NEW*() macros in SocketServer object.
This was missed inccc255d3
when the TLS server was introduced, probably because work on that commit preceded when the macros were introduced in475b57c8
. It would have been easy to miss in a merge.
This commit is contained in:
@ -155,13 +155,12 @@ sckServerNew(const String *const address, const unsigned int port, const TimeMSe
|
||||
|
||||
IoServer *this = NULL;
|
||||
|
||||
MEM_CONTEXT_NEW_BEGIN("SocketServer")
|
||||
OBJ_NEW_BEGIN(SocketServer)
|
||||
{
|
||||
SocketServer *driver = memNew(sizeof(SocketServer));
|
||||
SocketServer *const driver = OBJ_NEW_ALLOC();
|
||||
|
||||
*driver = (SocketServer)
|
||||
{
|
||||
.memContext = MEM_CONTEXT_NEW(),
|
||||
.address = strDup(address),
|
||||
.port = port,
|
||||
.name = strNewFmt("%s:%u", strZ(address), port),
|
||||
@ -185,7 +184,7 @@ sckServerNew(const String *const address, const unsigned int port, const TimeMSe
|
||||
"unable to set SO_REUSEADDR");
|
||||
|
||||
// Ensure file descriptor is closed
|
||||
memContextCallbackSet(driver->memContext, sckServerFreeResource, driver);
|
||||
memContextCallbackSet(objMemContext(driver), sckServerFreeResource, driver);
|
||||
|
||||
// Bind the address
|
||||
THROW_ON_SYS_ERROR(
|
||||
@ -205,7 +204,7 @@ sckServerNew(const String *const address, const unsigned int port, const TimeMSe
|
||||
|
||||
this = ioServerNew(driver, &sckServerInterface);
|
||||
}
|
||||
MEM_CONTEXT_NEW_END();
|
||||
OBJ_NEW_END();
|
||||
|
||||
FUNCTION_LOG_RETURN(IO_SERVER, this);
|
||||
}
|
||||
|
Reference in New Issue
Block a user