MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / dupSentinelAddr

Function dupSentinelAddr

src/sentinel.cpp:622–630  ·  view source on GitHub ↗

Return a duplicate of the source address. */

Source from the content-addressed store, hash-verified

620
621/* Return a duplicate of the source address. */
622sentinelAddr *dupSentinelAddr(sentinelAddr *src) {
623 sentinelAddr *sa;
624
625 sa = (sentinelAddr*)zmalloc(sizeof(*sa), MALLOC_LOCAL);
626 sa->hostname = sdsnew(src->hostname);
627 sa->ip = sdsnew(src->ip);
628 sa->port = src->port;
629 return sa;
630}
631
632/* Free a Sentinel address. Can't fail. */
633void releaseSentinelAddr(sentinelAddr *sa) {

Calls 2

zmallocFunction · 0.85
sdsnewFunction · 0.85

Tested by

no test coverage detected