openbmc/build/tmp/deploy/sdk/witherspoon-2019-08-08/sysroots/armv6-openbmc-linux-gnueabi/usr/src/debug/rsyslog/8.1903.0-r0/rsyslog-8.1903.0/runtime/net.c
static rsRetVal AddPermittedPeer(permittedPeers_t** ppRootPeer, uchar* pszID)
{
    permittedPeers_t* pNew = NULL;
    DEFiRet;

    assert(ppRootPeer != NULL);
    assert(pszID != NULL);

    CHKmalloc(
        pNew = calloc(
            1, sizeof(permittedPeers_t))); /* we use calloc() for consistency
                                              with "real" objects */
    CHKmalloc(pNew->pszID = (uchar*)strdup((char*)pszID));

    if (*ppRootPeer != NULL)
    {
        pNew->pNext = *ppRootPeer;
    }
    *ppRootPeer = pNew;

finalize_it:
    if (iRet != RS_RET_OK)
    {
        if (pNew != NULL)
            free(pNew);
    }
    RETiRet;
}
/* add a permitted peer. PermittedPeers is an interim solution until we can
 * provide access control via enhanced RainerScript methods. Note: the provided
 * string is handed over to this function, caller must no longer access it. --
 * rgerhards, 2008-05-19
 */
add a permitted peer. PermittedPeers is an interim solution until we can
provide access control via enhanced RainerScript methods. Note: the provided
string is handed over to this function, caller must no longer access it.
add a permitted peer . PermittedPeers is an interim solution until we can provide access control via enhanced RainerScript methods . Note : the provided string is handed over to this function caller must no longer access it .
static rsRetVal AddPermittedPeer(permittedPeers_t** ppRootPeer, uchar* pszID)
{
    permittedPeers_t* pNew = NULL;
    DEFiRet;
    assert(ppRootPeer != NULL);
    assert(pszID != NULL);
    CHKmalloc(
        pNew = calloc(
            1, sizeof(permittedPeers_t))); 
    CHKmalloc(pNew->pszID = (uchar*)strdup((char*)pszID));
    if (*ppRootPeer != NULL)
    {
        pNew->pNext = *ppRootPeer;
    }
    *ppRootPeer = pNew;
finalize_it:
    if (iRet != RS_RET_OK)
    {
        if (pNew != NULL)
            free(pNew);
    }
    RETiRet;
}
static rsRetVal AddPermittedPeer ( permittedPeers_t * * ppRootPeer , uchar * pszID ) { permittedPeers_t * pNew = NULL ; DEFiRet ; assert ( ppRootPeer != NULL ) ; assert ( pszID != NULL ) ; CHKmalloc ( pNew = calloc ( 1 , sizeof ( permittedPeers_t ) ) ) ; CHKmalloc ( pNew -> pszID = ( uchar * ) strdup ( ( char * ) pszID ) ) ; if ( * ppRootPeer != NULL ) { pNew -> pNext = * ppRootPeer ; } * ppRootPeer = pNew ; finalize_it : if ( iRet != RS_RET_OK ) { if ( pNew != NULL ) free ( pNew ) ; } RETiRet ; }
add a permitted peer.
add a permitted peer .
/* we use calloc() for consistency
                                              with "real" objects */