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 /tcpclt.c | |
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 'tcpclt.c')
-rw-r--r-- | tcpclt.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -169,7 +169,7 @@ TCPSendBldFrame(tcpclt_t *pThis, char **pmsg, size_t *plen, int *pbMustBeFreed) * I have added this comment so that the logic is not accidently * changed again. rgerhards, 2005-10-25 */ - if((buf = malloc((len + 2) * sizeof(char))) == NULL) { + if((buf = MALLOC((len + 2) * sizeof(char))) == NULL) { /* extreme mem shortage, try to solve * as good as we can. No point in calling * any alarms, they might as well run out @@ -217,7 +217,7 @@ TCPSendBldFrame(tcpclt_t *pThis, char **pmsg, size_t *plen, int *pbMustBeFreed) /* IETF20061218 iLenBuf = snprintf(szLenBuf, sizeof(szLenBuf)/sizeof(char), "%d ", len + iLenBuf);*/ - if((buf = malloc((len + iLenBuf) * sizeof(char))) == NULL) { + if((buf = MALLOC((len + iLenBuf) * sizeof(char))) == NULL) { /* we are out of memory. This is an extreme situation. We do not * call any alarm handlers because they most likely run out of mem, * too. We are brave enough to call debug output, though. Other than @@ -324,7 +324,7 @@ Send(tcpclt_t *pThis, void *pData, char *msg, size_t len) * happens is that we lose our message recovery buffer - anything else would * be worse, so don't try anything ;) -- rgerhards, 2008-03-12 */ - if((pThis->prevMsg = malloc(len)) != NULL) { + if((pThis->prevMsg = MALLOC(len)) != NULL) { memcpy(pThis->prevMsg, msg, len); pThis->lenPrevMsg = len; } |