diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2009-10-22 11:33:38 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2009-10-22 11:33:38 +0200 |
commit | e04e1b50025f5fa9c26abd946190dce8f797d08f (patch) | |
tree | b5348b56bbd4b72ff713c2650cd4661318f8e8b1 /plugins/imudp | |
parent | 9079f6683057c5aad0a73eb56e33a1f1445f6e65 (diff) | |
download | rsyslog-e04e1b50025f5fa9c26abd946190dce8f797d08f.tar.gz rsyslog-e04e1b50025f5fa9c26abd946190dce8f797d08f.tar.xz rsyslog-e04e1b50025f5fa9c26abd946190dce8f797d08f.zip |
enhanced test environment (including testbench)
support for enhancing probability of memory addressing failure by
using non-NULL default value for malloced memory (optional, only if
requested by configure option). This helps to track down some
otherwise undetected issues within the testbench and is expected
to be very useful in the future.
Diffstat (limited to 'plugins/imudp')
-rw-r--r-- | plugins/imudp/imudp.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/plugins/imudp/imudp.c b/plugins/imudp/imudp.c index 6ce8039f..5fe82470 100644 --- a/plugins/imudp/imudp.c +++ b/plugins/imudp/imudp.c @@ -118,13 +118,13 @@ static rsRetVal addListner(void __attribute__((unused)) *pVal, uchar *pNewVal) /* esay, we can just replace it */ udpLstnSocks = newSocks; RUNLOG_VAR("%d", newSocks[0]); - CHKmalloc(udpRulesets = (ruleset_t**) malloc(sizeof(ruleset_t*) * (newSocks[0] + 1))); + CHKmalloc(udpRulesets = (ruleset_t**) MALLOC(sizeof(ruleset_t*) * (newSocks[0] + 1))); for(iDst = 1 ; iDst <= newSocks[0] ; ++iDst) udpRulesets[iDst] = pBindRuleset; } else { /* we need to add them */ - tmpSocks = (int*) malloc(sizeof(int) * (1 + newSocks[0] + udpLstnSocks[0])); - tmpRulesets = (ruleset_t**) malloc(sizeof(ruleset_t*) * (1 + newSocks[0] + udpLstnSocks[0])); + tmpSocks = (int*) MALLOC(sizeof(int) * (1 + newSocks[0] + udpLstnSocks[0])); + tmpRulesets = (ruleset_t**) MALLOC(sizeof(ruleset_t*) * (1 + newSocks[0] + udpLstnSocks[0])); if(tmpSocks == NULL || tmpRulesets == NULL) { DBGPRINTF("out of memory trying to allocate udp listen socket array\n"); /* in this case, we discard the new sockets but continue with what we @@ -467,7 +467,7 @@ CODESTARTwillRun iMaxLine = glbl.GetMaxLine(); - CHKmalloc(pRcvBuf = malloc((iMaxLine + 1) * sizeof(char))); + CHKmalloc(pRcvBuf = MALLOC((iMaxLine + 1) * sizeof(char))); finalize_it: ENDwillRun |