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/plugins/imtcp/imtcp.c
static rsRetVal addInstance(void __attribute__((unused)) * pVal, uchar* pNewVal)
{
    instanceConf_t* inst;
    DEFiRet;

    CHKiRet(createInstance(&inst));

    CHKmalloc(inst->pszBindPort = ustrdup((pNewVal == NULL || *pNewVal == '\0')
                                              ? (uchar*)"10514"
                                              : pNewVal));
    if ((cs.pszBindRuleset == NULL) || (cs.pszBindRuleset[0] == '\0'))
    {
        inst->pszBindRuleset = NULL;
    }
    else
    {
        CHKmalloc(inst->pszBindRuleset = ustrdup(cs.pszBindRuleset));
    }
    if ((cs.lstnIP == NULL) || (cs.lstnIP[0] == '\0'))
    {
        inst->pszBindAddr = NULL;
    }
    else
    {
        CHKmalloc(inst->pszBindAddr = ustrdup(cs.lstnIP));
    }

    if ((cs.pszInputName == NULL) || (cs.pszInputName[0] == '\0'))
    {
        inst->pszInputName = NULL;
    }
    else
    {
        CHKmalloc(inst->pszInputName = ustrdup(cs.pszInputName));
    }
    inst->bSuppOctetFram = cs.bSuppOctetFram;

finalize_it:
    free(pNewVal);
    RETiRet;
}
/* This function is called when a new listener instace shall be added to
 * the current config object via the legacy config system. It just shuffles
 * all parameters to the listener in-memory instance.
 * rgerhards, 2011-05-04
 */
This function is called when a new listener instace shall be added to
the current config object via the legacy config system. It just shuffles
all parameters to the listener in-memory instance.
This function is called when a new listener instace shall be added to the current config object via the legacy config system . It just shuffles all parameters to the listener in - memory instance .
static rsRetVal addInstance(void __attribute__((unused)) * pVal, uchar* pNewVal)
{
    instanceConf_t* inst;
    DEFiRet;
    CHKiRet(createInstance(&inst));
    CHKmalloc(inst->pszBindPort = ustrdup((pNewVal == NULL || *pNewVal == '\0')
                                              ? (uchar*)"10514"
                                              : pNewVal));
    if ((cs.pszBindRuleset == NULL) || (cs.pszBindRuleset[0] == '\0'))
    {
        inst->pszBindRuleset = NULL;
    }
    else
    {
        CHKmalloc(inst->pszBindRuleset = ustrdup(cs.pszBindRuleset));
    }
    if ((cs.lstnIP == NULL) || (cs.lstnIP[0] == '\0'))
    {
        inst->pszBindAddr = NULL;
    }
    else
    {
        CHKmalloc(inst->pszBindAddr = ustrdup(cs.lstnIP));
    }
    if ((cs.pszInputName == NULL) || (cs.pszInputName[0] == '\0'))
    {
        inst->pszInputName = NULL;
    }
    else
    {
        CHKmalloc(inst->pszInputName = ustrdup(cs.pszInputName));
    }
    inst->bSuppOctetFram = cs.bSuppOctetFram;
finalize_it:
    free(pNewVal);
    RETiRet;
}
static rsRetVal addInstance ( void __attribute__ ( ( unused ) ) * pVal , uchar * pNewVal ) { instanceConf_t * inst ; DEFiRet ; CHKiRet ( createInstance ( & inst ) ) ; CHKmalloc ( inst -> pszBindPort = ustrdup ( ( pNewVal == NULL || * pNewVal == ' \0 ' ) ? ( uchar * ) " " : pNewVal ) ) ; if ( ( cs . pszBindRuleset == NULL ) || ( cs . pszBindRuleset [ 0 ] == ' \0 ' ) ) { inst -> pszBindRuleset = NULL ; } else { CHKmalloc ( inst -> pszBindRuleset = ustrdup ( cs . pszBindRuleset ) ) ; } if ( ( cs . lstnIP == NULL ) || ( cs . lstnIP [ 0 ] == ' \0 ' ) ) { inst -> pszBindAddr = NULL ; } else { CHKmalloc ( inst -> pszBindAddr = ustrdup ( cs . lstnIP ) ) ; } if ( ( cs . pszInputName == NULL ) || ( cs . pszInputName [ 0 ] == ' \0 ' ) ) { inst -> pszInputName = NULL ; } else { CHKmalloc ( inst -> pszInputName = ustrdup ( cs . pszInputName ) ) ; } inst -> bSuppOctetFram = cs . bSuppOctetFram ; finalize_it : free ( pNewVal ) ; RETiRet ; }
This function is called when a new listener instace shall be added to
 the current config object via the legacy config system.
This function is called when a new listener instace shall be added to the current config object via the legacy config system .